/*
Theme Name:  Captain Base
Theme URI:   https://onlinekapitany.hu
Description: Könnyű, token-alapú alap-téma az Alfred + HTML Szekciók stackhez. Design-tokenek WP Customizerből.
Version:     1.0.0
Author:      Online Captain Systems Kft.
Author URI:  https://onlinekapitany.hu
License:     Proprietary
Text Domain: captain-base
Tags:        custom-colors, custom-logo, custom-menu, full-width-template
*/

/* ── Fallback CSS custom properties (Customizer felülírja wp_head-ben) ─────── */
:root {
  --primary:    #16356B;
  --primary-2:  #0F2750;
  --accent:     #10B981;
  --accent-2:   #0E9F70;
  --ink:        #1A2233;
  --text-mid:   #5A6781;
  --grey:       #D7DEEA;
  --grey-bg:    #EEF3FB;
  --white:      #fff;
  --head-font:  'Plus Jakarta Sans', sans-serif;
  --body-font:  'Inter', sans-serif;
  --wrap:       1140px;
  --radius:     10px;
}

/* ── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--head-font);
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout helpers ─────────────────────────────────────────────────────────── */
.cb-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 2.4rem); }
.cb-section { padding: clamp(3rem, 6vw, 5rem) 0; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.cb-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--head-font) !important;
  font-weight: 700 !important;
  font-size: .9rem;
  padding: .85rem 1.7rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .2s, color .2s, transform .15s;
  line-height: 1;
}
.cb-btn:hover { transform: translateY(-2px); }
.cb-btn--primary { background: var(--primary) !important; color: var(--white) !important; }
.cb-btn--primary:hover { background: var(--primary-2) !important; }
.cb-btn--accent  { background: var(--accent) !important;  color: var(--white) !important; }
.cb-btn--accent:hover  { background: var(--accent-2) !important; }
.cb-btn--ghost   { background: transparent !important; border: 1.5px solid var(--primary); color: var(--primary) !important; }
.cb-btn--ghost:hover { background: var(--primary) !important; color: var(--white) !important; }

/* ── Navigation (cb-nav) ────────────────────────────────────────────────────── */
.cb-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--grey);
  box-shadow: 0 2px 12px rgba(22,53,107,.06);
}
.cb-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}
.cb-nav__logo { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.cb-nav__logo img { height: 36px; width: auto; }
.cb-nav__logo .cb-nav__site-name {
  font-family: var(--head-font);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  white-space: nowrap;
}
.cb-nav__menu { list-style: none; display: flex; gap: .2rem; }
.cb-nav__menu a {
  font-family: var(--head-font);
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink);
  padding: .5rem .8rem;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.cb-nav__menu a:hover, .cb-nav__menu .current-menu-item a { background: var(--grey-bg); color: var(--primary); text-decoration: none; }
.cb-nav__cta { flex-shrink: 0; }

/* hamburger */
.cb-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  border-radius: 8px;
}
.cb-nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.cb-nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cb-nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cb-nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .cb-nav__toggle { display: flex; }
  .cb-nav__menu-wrap {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--grey);
    padding: 1rem 1.2rem 1.4rem;
  }
  .cb-nav__menu-wrap.is-open { display: block; }
  .cb-nav__menu { flex-direction: column; gap: .1rem; }
  .cb-nav__menu a { display: block; padding: .65rem .9rem; }
  .cb-nav__cta { margin-top: .8rem; }
  .cb-nav__cta .cb-btn { width: 100%; justify-content: center; }
}

/* ── Footer (cb-foot) ───────────────────────────────────────────────────────── */
.cb-foot {
  background: var(--primary-2);
  color: #9fb0d0;
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.4rem;
}
.cb-foot a { color: #9fb0d0; transition: color .2s; }
.cb-foot a:hover { color: var(--white); text-decoration: none; }
.cb-foot__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.cb-foot__brand p { font-size: .85rem; line-height: 1.75; margin-top: .7rem; }
.cb-foot__col h4 {
  font-family: var(--head-font);
  color: var(--white);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .8rem;
}
.cb-foot__col ul { list-style: none; }
.cb-foot__col li + li { margin-top: .35rem; }
.cb-foot__col a { font-size: .85rem; }
.cb-foot__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: 1.2rem;
  font-size: .76rem;
  color: #6f80a3;
}
@media (max-width: 860px) { .cb-foot__grid { grid-template-columns: 1fr; } }

/* ── Main content area (page.php) ───────────────────────────────────────────── */
.cb-page-content { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.cb-page-content .entry-header { margin-bottom: 1.5rem; }
.cb-page-content .entry-content { max-width: 720px; }
.cb-page-content .entry-content > * + * { margin-top: 1rem; }
.cb-page-content .entry-content h2 { margin-top: 2rem; }
.cb-page-content .entry-content h3 { margin-top: 1.5rem; }
.cb-page-content .entry-content ul, .cb-page-content .entry-content ol { padding-left: 1.4rem; }
.cb-page-content .entry-content li + li { margin-top: .4rem; }
.cb-page-content .entry-content table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
.cb-page-content .entry-content th, .cb-page-content .entry-content td { border: 1px solid var(--grey); padding: .55rem .8rem; font-size: .88rem; text-align: left; }
.cb-page-content .entry-content th { background: var(--grey-bg); font-family: var(--head-font); font-weight: 700; }

/* ── Archive / Single (generic CPT) ─────────────────────────────────────────── */
.cb-archive { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.cb-archive__head { margin-bottom: 2rem; }
.cb-archive__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; }
.cb-card {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  min-width: 0;
}
.cb-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(22,53,107,.1); }
.cb-card__img { height: 200px; overflow: hidden; background: var(--grey-bg); }
.cb-card__img img { width: 100%; height: 100%; object-fit: cover; }
.cb-card__body { padding: 1.2rem 1.4rem; }
.cb-card__body h3 { font-size: 1rem; margin-bottom: .4rem; }
.cb-card__body p { font-size: .85rem; color: var(--text-mid); }
.cb-card__link { display: inline-flex; align-items: center; gap: .3rem; margin-top: .8rem; font-family: var(--head-font); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
@media (max-width: 860px) { .cb-archive__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .cb-archive__grid { grid-template-columns: 1fr; } }

.cb-single { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.cb-single__thumb { margin-bottom: 2rem; border-radius: 14px; overflow: hidden; max-height: 460px; }
.cb-single__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cb-single__meta { font-size: .82rem; color: var(--text-mid); margin-bottom: 1rem; }
.cb-single__content > * + * { margin-top: 1rem; }

/* ── 404 ────────────────────────────────────────────────────────────────────── */
.cb-404 { padding: clamp(4rem, 10vw, 7rem) 0; text-align: center; }
.cb-404 h1 { font-size: clamp(4rem, 12vw, 8rem); color: var(--grey); margin-bottom: .5rem; }
.cb-404 h2 { margin-bottom: 1rem; }
.cb-404 p { color: var(--text-mid); margin-bottom: 1.8rem; }

/* ── Canvas / Elementor Canvas: suppress body-level whitespace gaps ─────────── */
/* wpautop and the_content() inject <link>/<style> tags + whitespace text-nodes
   at body level, creating phantom line-boxes and <p> margin-bottom gaps.
   Setting line-height:0 on the body collapses the whitespace rows to zero;
   restoring it on block children keeps normal typography inside sections. */
body.elementor-template-canvas,
body.cb-canvas {
  line-height: 0;
}
body.elementor-template-canvas > *,
body.cb-canvas > * {
  line-height: 1.65;
}
body.elementor-template-canvas > p,
body.cb-canvas > p {
  margin: 0;
  font-size: 0;
  line-height: 0;
}
body.elementor-template-canvas > br,
body.cb-canvas > br { display: none; }

/* ── Accessibility ──────────────────────────────────────────────────────────── */
.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; width: 1px; word-wrap: normal !important;
}
