/*
Theme Name: Braccaedomos
Theme URI: https://braccaedomos.com
Author: Gerard van Broekhuijsen
Author URI: https://braccaedomos.com
Description: Een persoonlijk WordPress-thema voor braccaedomos.com — filosoof, pacifist & designer. Met zes themategels op de startpagina, een overzichtelijke menustructuur en een rustig, modern ontwerp.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: braccaedomos
Tags: two-columns, right-sidebar, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, blog
*/

/* ==========================================================================
   CSS VARIABELEN
   ========================================================================== */
:root {
  --bg: #eaf2f8;
  --surface: #ffffff;
  --primary: #2c5f8a;
  --primary-dark: #1a3e5c;
  --accent: #d4881a;
  --accent-light: #e8a547;
  --text: #2a2a2a;
  --text-light: #6a6a6a;
  --border: #d5e0ea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.15);
  --container: 1200px;
  --content-width: 760px;
  --font-body: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-heading: Georgia, "Times New Roman", serif;
}

/* ==========================================================================
   RESET & BASIS
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.5em; }

blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: rgba(212, 136, 26, 0.05);
  font-style: italic;
  color: var(--text-light);
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */
.site-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.site-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}

.site-content.no-sidebar {
  grid-template-columns: 1fr;
  max-width: var(--content-width);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-logo-custom {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  font-weight: bold;
  flex-shrink: 0;
  font-family: var(--font-body);
}

.custom-logo-link img {
  max-height: 56px;
  width: auto;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  font-family: var(--font-body);
}

.site-title a { color: var(--primary-dark); }

.site-tagline {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  border: 1px solid var(--border);
  width: 220px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text);
}

.search-box svg { flex-shrink: 0; color: var(--text-light); }

.translate-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.translate-btn:hover { opacity: 0.85; }

/* ==========================================================================
   NAVIGATIE
   ========================================================================== */
.main-nav { background: var(--primary); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  flex-wrap: wrap;
}

.nav-inner a {
  color: white;
  text-decoration: none;
  padding: 14px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  border-bottom: 3px solid transparent;
}

.nav-inner a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: var(--accent);
}

.nav-inner .current-menu-item > a,
.nav-inner .current-menu-parent > a,
.nav-inner .current-menu-ancestor > a {
  border-bottom-color: var(--accent);
}

.nav-inner .caret { font-size: 0.7rem; opacity: 0.7; }

/* Dropdown */
.nav-inner ul ul {
  position: absolute;
  background: var(--primary-dark);
  min-width: 220px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
}

.nav-inner li { position: relative; }

.nav-inner ul ul a {
  padding: 12px 18px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-width: 1px;
}

.nav-inner ul ul li:last-child a { border-bottom: none; }

.nav-inner li:hover > ul { display: block; }

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px 16px;
}

/* ==========================================================================
   HERO (front-page)
   ========================================================================== */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 24px 32px;
  text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 12px; }

.hero p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 20px auto 0;
  border-radius: 2px;
}

/* ==========================================================================
   THEMA TEGELS (front-page)
   ========================================================================== */
.tiles-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tile {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.tile-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tile-image svg {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.tile-label {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tile-body {
  padding: 20px 22px 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.tile-body h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.tile-body p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.tile-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.tile:hover .tile-link { gap: 10px; }

/* Tile kleuren */
.tile-blog { background: linear-gradient(135deg, #4a6fa5, #2e4e7e); }
.tile-vrede { background: linear-gradient(135deg, #5b8c6a, #3d6b4a); }
.tile-gerard { background: linear-gradient(135deg, #8b6f8b, #6a526b); }
.tile-design { background: linear-gradient(135deg, #b07a5c, #8a5a3c); }
.tile-lab { background: linear-gradient(135deg, #5c8a96, #3d6671); }
.tile-filosofen { background: linear-gradient(135deg, #a6935c, #7a6a3d); }

.tile-label-vrede { color: #3d6b4a; }
.tile-label-design { color: #8a5a3c; }

/* Aangepaste tegel-afbeelding (via Customizer ge-upload) */
.tile-custom-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Wanneer een afbeelding is ingesteld, verberg de gradient */
.tile-image:has(.tile-custom-image),
.tile-image.has-custom-image {
  background: none;
}

/* Overlay op afbeelding voor leesbaarheid van badge */
.tile-image:has(.tile-custom-image) .tile-label,
.tile-image.has-custom-image .tile-label {
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ==========================================================================
   RECENTE BERICHTEN (front-page)
   ========================================================================== */
.recent-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 56px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header h2 { font-size: 1.4rem; }

.section-header .line {
  flex-grow: 1;
  height: 1px;
  background: var(--border);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.post-card:hover { box-shadow: var(--shadow-hover); }

.post-card-thumb {
  height: 160px;
  overflow: auto;
}

.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-card-placeholder {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
}

.post-bg-1 { background: linear-gradient(135deg, #2a4a6b, #1a3550); }
.post-bg-2 { background: linear-gradient(135deg, #3d6b4a, #2a4d35); }
.post-bg-3 { background: linear-gradient(135deg, #6b5b3d, #4d4028); }

.post-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.post-body h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-excerpt {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  flex-grow: 1;
}

.post-readmore {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* ==========================================================================
   BLOG / ARCHIEF WEERGAVE
   ========================================================================== */
.content-area { max-width: 100%; }

.post-list { display: flex; flex-direction: column; gap: 24px; }

.post-item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-item-thumb { max-height: 320px; overflow: hidden; }
.post-item-thumb img { width: 100%; height: auto; }

.post-item-body { padding: 24px 28px; }

.post-item-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-item-meta .cat { color: var(--accent); font-weight: 600; }

.post-item-body h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.post-item-body h2 a { color: var(--primary-dark); }
.post-item-body h2 a:hover { color: var(--accent); }

.post-item-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.post-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.read-more-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.read-more-btn:hover { background: var(--primary-dark); color: white; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  padding: 8px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.pagination .page-numbers.current { background: var(--primary); color: white; }
.pagination .page-numbers:hover:not(.current) { background: var(--border); }

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.single-post {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

.single-post-thumb img { width: 100%; max-height: 420px; object-fit: cover; }

.single-post-body { padding: 32px 40px; }

.single-post-header { margin-bottom: 24px; }

.single-post-header h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.single-post-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.single-post-content {
  line-height: 1.8;
  font-size: 1.05rem;
}

.single-post-content h2 { margin-top: 28px; margin-bottom: 12px; }
.single-post-content h3 { margin-top: 24px; margin-bottom: 8px; }
.single-post-content p { margin-bottom: 16px; }
.single-post-content img { border-radius: var(--radius-sm); margin: 16px 0; }
.single-post-content ul, .single-post-content ol { margin-bottom: 16px; }
.single-post-content a { color: var(--primary); text-decoration: underline; }
.single-post-content blockquote { margin: 20px 0; }
.single-post-content pre {
  background: var(--primary-dark);
  color: #e0e0e0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.single-post-content code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.single-post-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-links, .tag-links { font-size: 0.8rem; color: var(--text-light); }
.cat-links a, .tag-links a { font-weight: 600; }

/* ==========================================================================
   PAGINA (page.php)
   ========================================================================== */
.page-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 40px;
}

.page-content h1 { margin-bottom: 16px; }
.page-content .entry-content { line-height: 1.8; }
.page-content .entry-content p { margin-bottom: 16px; }
.page-content .entry-content h2 { margin-top: 28px; margin-bottom: 12px; }

/* ==========================================================================
   SIDEBAR / WIDGETS
   ========================================================================== */
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.widget-title {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--primary); }
.widget select { width: 100%; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 0.85rem; }
.widget input[type="search"], .widget input[type="text"] { width: 100%; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 0.85rem; }
.widget .search-submit { margin-top: 8px; padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; }

/* ==========================================================================
   COMMENTS
   ========================================================================== */
.comments-area {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 32px;
  margin-top: 24px;
}

.comments-title { font-size: 1.2rem; margin-bottom: 16px; }

.comment-list { list-style: none; padding: 0; }

.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }

.comment-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 8px; }
.comment-meta .comment-author { font-weight: 600; color: var(--primary-dark); }

.comment-reply-link { font-size: 0.8rem; color: var(--primary); }

.comment-respond { margin-top: 24px; }
.comment-respond .comment-reply-title { font-size: 1.1rem; margin-bottom: 12px; }
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 12px;
  font-family: var(--font-body);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--primary); }
.comment-form input[type="submit"] {
  width: auto;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 24px;
}
.comment-form input[type="submit"]:hover { background: var(--primary-dark); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 32px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; gap: 20px; list-style: none; padding: 0; }
.footer-links a { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); }

/* ==========================================================================
   404 / SEARCH NO RESULTS
   ========================================================================== */
.no-results {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.no-results h1 { font-size: 1.6rem; margin-bottom: 12px; }
.no-results p { color: var(--text-light); margin-bottom: 24px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .tiles-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .site-content { grid-template-columns: 1fr; }
  .widget-area { order: 2; }
  .header-inner { flex-wrap: wrap; }
  .search-box { width: 100%; order: 3; }
  .nav-inner { flex-wrap: wrap; }
  .nav-inner a { padding: 12px 14px; font-size: 0.82rem; }
  .hero h1 { font-size: 1.5rem; }
  .single-post-body, .page-content { padding: 24px 20px; }
  .single-post-footer { padding: 16px 20px; }
}

@media (max-width: 600px) {
  .tiles-grid, .posts-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .nav-inner {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .nav-inner.toggled { display: flex; }
  .nav-inner a { padding: 12px 24px; }
  .nav-inner ul ul { position: static; display: block; background: rgba(0,0,0,0.15); }
  .nav-inner .caret { display: none; }
  .header-actions { width: 100%; }
  .search-box { width: 100%; }
  .translate-btn { display: none; }
  .hero { padding: 32px 24px 24px; }
  .hero h1 { font-size: 1.3rem; }
  .hero p { font-size: 0.95rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Screen reader text */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important;
  width: 1px; word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus { left: 0; }

.alignleft { float: left; margin: 0 20px 12px 0; }
.alignright { float: right; margin: 0 0 12px 20px; }
.aligncenter { display: block; margin: 16px auto; }

.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: 0.8rem; color: var(--text-light); text-align: center; }

.sticky { border-left: 4px solid var(--accent); }
.gallery-caption { display: block; }
