/* ============================================================
   PannonArchív — v5 · „Mély kontraszt" változat
   Based on Claude Design c-kontraszt reference — exact values.
   Extended with dropdowns, hamburger, buttons, grids, forms.
   Fraunces serif for display headings.
   ============================================================ */

:root {
  --navy-950: #0F1B28;
  --navy-900: #14222F;
  --brand: #5CB88A;
  --brand-ink: #35835C;
  --brand-dark: #1D5A40;
  --paper: #F2EFE8;
  --line: #DCD6C8;
  --ink: #2A2F36;
  --muted: #5A6472;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* --- Reset & Base (from reference) --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.65; overflow-x: hidden; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* --- Layout --- */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.content-wrapper { flex: 1; max-width: 1100px; margin: 0 auto; padding: 2.5rem 32px; width: 100%; }

/* ============================================================
   DARK HEADER BLOCK — on ALL pages
   nav-placeholder gets the dark gradient so subpages match homepage
   ============================================================ */
/* On homepage .masthead wraps nav+hero — gradient on masthead only.
   On subpages nav-placeholder is standalone — gradient on it directly.
   .masthead #nav-placeholder gets transparent so it doesn't double up. */
#nav-placeholder { background: radial-gradient(110% 130% at 85% -20%, #1E4D3C 0%, var(--navy-900) 55%, var(--navy-950) 100%); background-size: 100% 350px; background-repeat: no-repeat; background-color: var(--navy-950); }
.masthead { background: radial-gradient(110% 130% at 85% -20%, #1E4D3C 0%, var(--navy-900) 55%, var(--navy-950) 100%); }
.masthead #nav-placeholder { background: transparent; }

/* --- Header (inside masthead) --- */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.logo { font-family: var(--serif); font-size: 26px; font-weight: bold; color: #fff; }
.logo a { color: #fff; text-decoration: none; }
.logo a:hover { color: #fff; text-decoration: none; }
.logo .logo-green { color: var(--brand); }
.topbar-contact { display: flex; gap: 28px; font-size: 14px; align-items: center; }
.topbar-contact .phone { color: var(--brand); font-weight: bold; }
.topbar-contact a.phone { color: var(--brand); }
.topbar-contact .email { color: #A8B8C6; }
.topbar-contact a.email { color: #A8B8C6; }
.topbar-contact a:hover { color: #fff; text-decoration: none; }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; transition: transform 0.2s, opacity 0.2s; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Nav (from reference EXACT) --- */
.mainnav { border-bottom: 1px solid rgba(255, 255, 255, .14); margin-top: 20px; }
.mainnav ul { list-style: none; display: flex; gap: 28px; }
.mainnav li { position: relative; }
.mainnav > .container > ul > li > a,
.mainnav > ul > li > a { display: block; padding: 0 12px 14px; color: #A8B8C6; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; position: relative; z-index: 101; }
.mainnav a { color: #A8B8C6; text-decoration: none; white-space: nowrap; }
.mainnav a:hover { color: #fff; text-decoration: none; }
.mainnav > .container > ul > li:hover > a,
.mainnav > ul > li:hover > a { border-bottom-color: var(--brand); color: #fff; }
.mainnav > .container > ul > li.active > a,
.mainnav > ul > li.active > a { color: #fff; font-weight: bold; border-bottom-color: var(--brand); }

/* Dropdown — extends reference for submenus */
.mainnav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--navy-900);
  border-top: none;
  min-width: 240px;
  z-index: 100;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
.mainnav .dropdown li { list-style: none; }
.mainnav .dropdown a { display: block; padding: 12px 24px; font-size: 14px; color: #A8B8C6; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 0; border-left: none; }
.mainnav .dropdown a:hover { background: rgba(92, 184, 138, 0.12); color: #fff; }
body:not(.nav-compact) .mainnav li:hover > .dropdown { display: block; }
.nav-toggle { display: none; }

/* --- Hero — trimmed bottom, cards overlap onto dark block --- */
.hero { padding: 84px 32px 110px; text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: normal; font-size: 62px; color: #fff; line-height: 1.12; }
.hero .hero-sub { display: block; margin-top: 24px; font-family: var(--sans); font-size: 13px; font-weight: bold; letter-spacing: .24em; text-transform: uppercase; color: var(--brand); }
.hero-cta { margin-top: 32px; }

/* --- Service Cards — 6-col grid, row 2 centered --- */
.service-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 26px; max-width: 1100px; margin: -64px auto 0; padding: 0 32px; position: relative; z-index: 10; }
.service-cards-secondary { display: none; } /* folded into main grid */
.service-card { grid-column: span 2; background: #fff; box-shadow: 0 4px 16px rgba(15, 27, 40, .12); padding: 32px 30px 26px; display: flex; flex-direction: column; gap: 13px; }
.service-card:nth-child(4) { grid-column: 2 / span 2; }
.service-card:nth-child(5) { grid-column: 4 / span 2; }
.service-card h2 { font-family: var(--serif); font-weight: bold; font-size: 22px; color: var(--navy-900); line-height: 1.3; }
.service-card p { font-size: 15px; color: var(--muted); flex: 1 1 auto; }
.card-link { font-size: 12.5px; font-weight: bold; letter-spacing: .1em; text-transform: uppercase; margin-top: auto; }
.card-link:hover { color: var(--navy-900); text-decoration: none; }

/* --- Welcome: photo top-aligned with text, signature under hairline --- */
.welcome-section { display: grid; grid-template-columns: 8fr 3fr; gap: 64px; max-width: 1100px; margin: 0 auto; padding: 84px 32px 96px; align-items: start; }
.welcome-aside img { width: 250px; max-width: 100%; display: block; }
.welcome-aside .signature { width: 250px; max-width: 100%; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.welcome-aside p { margin-top: 16px; font-size: 15px; color: var(--muted); }
.welcome-text p { margin-bottom: 18px; }
.welcome-text p:first-of-type { font-family: var(--serif); font-size: 23px; line-height: 1.55; margin-bottom: 26px; }
.welcome-text p:last-child { margin-bottom: 0; }
.welcome-section strong { color: var(--navy-900); }

/* --- Footer (from reference EXACT) --- */
footer { background: var(--navy-950); border-top: 2px solid var(--brand); padding: 40px 32px 32px; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 40px; list-style: none; margin-bottom: 18px; }
.footer-links a { color: #9CC9B0; font-size: 14px; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.copyright { color: #4E6075; font-size: 13px; }
/* Also support v4 class names that main.js might inject */
.site-footer { background: var(--navy-950); border-top: 2px solid var(--brand); padding: 40px 32px 32px; text-align: center; }
/* Ensure dark bg behind footer so CTA→footer transition is seamless */
#footer-placeholder { background: var(--navy-950); }
.footer-copyright { text-align: center; color: #4E6075; font-size: 13px; }

/* ============================================================
   EXTENDED COMPONENTS — styled to match kontraszt aesthetic
   ============================================================ */

/* --- Page Title --- */
.page-title { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 2rem; position: relative; }
.page-title::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 56px; height: 3px; background: var(--brand); }
.page-title h1 { font-family: var(--serif); font-size: 1.85rem; color: var(--ink); font-weight: 600; }

/* --- Article Content --- */
.article-content { line-height: 1.8; }
.article-content p { margin-bottom: 1rem; }
.article-content img { float: left; margin: 0.3rem 1.5rem 1rem 0; max-width: 250px; border: 1px solid rgba(15,27,40,0.12); }
.article-content img.wide { float: none; width: 100%; max-width: 100%; max-height: 300px; object-fit: cover; margin: 0 0 1.5rem 0; }
.article-content h2 { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); margin: 1.75rem 0 0.75rem; font-weight: 600; }
.article-content h3 { font-size: 1.1rem; color: var(--ink); margin: 1.25rem 0 0.5rem; font-weight: 600; }
.article-content ul, .article-content ol { margin: 0.75rem 0 1rem 1.5rem; }
.article-content li { margin-bottom: 0.3rem; }
.article-content strong { color: var(--ink); }
.article-content::after { content: ''; display: table; clear: both; }

/* --- Image Grid & Before/After --- */
.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; clear: both; }
.image-grid img { float: none; max-width: 100%; width: 100%; height: 280px; object-fit: cover; margin: 0; border: 1px solid rgba(15,27,40,0.12); }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; clear: both; }
.before-after figure { margin: 0; }
.before-after img { float: none; max-width: 100%; width: 100%; height: 280px; object-fit: cover; margin: 0; border: 1px solid rgba(15,27,40,0.12); }
.before-after figcaption { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.4rem; text-align: center; }

/* --- Section TOC --- */
.section-toc { list-style: none; }
.section-toc li { border-bottom: 1px solid var(--line); }
.section-toc a { display: block; padding: 1rem 0 1rem 1rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); transition: background 0.15s; }
.section-toc a:hover { color: var(--brand-ink); text-decoration: none; background: rgba(92,184,138,0.06); padding-left: 1.25rem; }
.section-toc .toc-desc { display: block; font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.55; font-weight: 400; }

/* --- Related Services --- */
.related-services { clear: both; margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--brand); }
.related-services h3 { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.85rem; font-weight: 700; }
.related-services ul { list-style: none; padding: 0; }
.related-services li { margin-bottom: 0.4rem; }
.related-services a { font-size: 0.9rem; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 14px 28px; font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; border: 1px solid var(--brand-ink); border-radius: 0; cursor: pointer; transition: background 0.2s, color 0.2s; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--navy-950); border-color: var(--brand); font-weight: bold; }
.btn-primary:hover { background: #4DA87A; color: var(--navy-950); }

/* --- Page CTA — dark band --- */
.page-cta {
  clear: both;
  margin-top: 2.5rem;
  /* Break out of content-wrapper to full width */
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-bottom: -2.5rem;
  padding: 3rem 32px;
  background: var(--navy-950);
  text-align: center;
}
.page-cta .btn-primary { background: var(--brand); color: var(--navy-950); }

/* --- Contact Form --- */
.contact-form { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.contact-form h2 { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group textarea { width: 100%; max-width: 100%; padding: 10px 14px; font-family: var(--sans); font-size: 15px; border: 1.5px solid rgba(15,27,40,0.25); background: var(--paper); color: var(--ink); border-radius: 0; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(92,184,138,0.15); }
.contact-form .btn { margin-top: 0.5rem; }

/* ============================================================
   RESPONSIVE / MOBILE
   ============================================================ */
body.nav-compact .hamburger { display: block; }
body.nav-compact .topbar-contact .email { display: none; }
body.nav-compact .topbar-contact .phone { font-size: 13px; }
body.nav-compact .mainnav { display: none; background: var(--navy-900); border-bottom: none; margin-top: 0; }
body.nav-compact .mainnav.open { display: block; }
body.nav-compact .mainnav ul { flex-direction: column; gap: 0; }
body.nav-compact .mainnav > .container > ul > li,
body.nav-compact .mainnav > ul > li { border-bottom: 1px solid rgba(255,255,255,0.08); }
body.nav-compact .mainnav > .container > ul > li > a,
body.nav-compact .mainnav > ul > li > a { display: inline-block; padding: 12px 20px; border-bottom: none; margin-bottom: 0; z-index: auto; }
body.nav-compact .mainnav .dropdown { position: static; display: none; box-shadow: none; background: var(--navy-950); border-top: none; }
body.nav-compact .mainnav .dropdown.open { display: block; }
body.nav-compact .mainnav .dropdown a { padding-left: 2.5rem; }
body.nav-compact .nav-toggle { display: inline-block; float: right; background: none; border: none; color: #A8B8C6; font-size: 1rem; padding: 12px 16px; cursor: pointer; }

@media (max-width: 1060px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .content-wrapper { padding: 1.5rem 16px; }
  .hero { padding: 2.5rem 16px 3rem; }
  .hero h1 { font-size: 2rem; }
  .service-cards { grid-template-columns: 1fr; margin-top: 1.5rem; padding: 0 16px; }
  .service-card { grid-column: span 1; }
  .service-card:nth-child(4), .service-card:nth-child(5) { grid-column: span 1; }
  .welcome-section { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 16px; }
  .welcome-aside img { width: 100%; }
  .welcome-aside .signature { width: 100%; }
  .article-content img { float: none; margin: 0 0 1rem 0; max-width: 100%; }
  footer { padding: 24px 16px; }
  .footer-links { flex-wrap: wrap; gap: 16px 24px; justify-content: center; }
}

@media (max-width: 600px) {
  .image-grid { grid-template-columns: 1fr; }
  .before-after { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { padding-top: 14px; padding-bottom: 14px; }
  .logo { font-size: 20px; }
  .btn { width: 100%; max-width: 320px; text-align: center; }
}
