/* =====================================================
   EDUDEL — Stiluri publice
   ===================================================== */

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

:root {
  --navy:   #1a3a6b;
  --navy-dark: #122850;
  --gold:   #c8a951;
  --gold-light: #e8cc7e;
  --white:  #ffffff;
  --bg:     #f7f5f0;
  --bg-card:#ffffff;
  --text:   #222222;
  --text-muted: #666;
  --border: #ddd7cc;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(26,58,107,.10);
  --shadow-hover: 0 6px 24px rgba(26,58,107,.18);
  --font-heading: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Container */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- HEADER ---- */
.site-header {
  background: #ffffff;
  color: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 2px 16px rgba(26,58,107,.06);
  border-bottom: 1px solid rgba(221,215,204,.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 76px;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 58px;
  width: auto;
  display: block;
  /* fallback daca fisierul lipseste */
}
/* Fallback text — se ascunde cand imaginea se incarca */
.logo-text-fallback {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .06em;
  display: none;
}
.logo-img-error .logo-img { display: none; }
.logo-img-error .logo-text-fallback { display: block; }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
}
.site-nav a,
.nav-dropdown-btn {
  color: var(--navy);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  padding: .45rem .85rem;
  border-radius: var(--radius);
  transition: background .18s, color .18s;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
}
.site-nav a:hover,
.nav-dropdown-btn:hover {
  background: rgba(26,58,107,.06);
  color: var(--navy-dark);
}
.site-nav a.active,
.nav-dropdown-btn.active {
  background: rgba(200,169,81,.12);
  color: var(--navy);
  font-weight: 600;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(26,58,107,.14);
  border: 1px solid var(--border);
  min-width: 230px;
  padding: .4rem 0;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  color: var(--navy) !important;
  padding: .6rem 1.1rem;
  font-size: .87rem;
  border-radius: 0;
}
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--navy-dark) !important; }

.arrow { font-size: .72em; color: var(--gold); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: .25s;
}

/* ---- MAIN ---- */
.site-main { flex: 1; }

/* ---- HERO (homepage) ---- */
.hero {
  position: relative;
  color: var(--white);
  padding: 7rem 0 6rem;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(18,40,80,.92) 0%, rgba(26,58,107,.80) 50%, rgba(42,82,152,.72) 100%),
    url('../images/hero.jpg') center center / cover no-repeat;
  overflow: hidden;
}
/* fallback gradient daca imaginea lipseste */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  z-index: -1;
}
.hero .container { position: relative; z-index: 1; }
.hero .hero-eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid rgba(232,204,126,.4);
  border-radius: 30px;
  padding: .35rem 1.1rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,.05);
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: .01em;
  line-height: 1.1;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero h1 .accent { color: var(--gold); }
.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,.92);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0,0,0,.3);
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-buttons .btn { padding: .85rem 2rem; font-size: .95rem; box-shadow: 0 4px 18px rgba(0,0,0,.2); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: .65rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btn-outline-light {
  border: 1.5px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  padding: .4rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-block;
  transition: border-color .18s;
}
.btn-outline-light:hover { border-color: var(--gold); color: var(--gold); }

/* ---- SECTIUNI HOMEPAGE ---- */
.section { padding: 4rem 0; }
.section-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  color: var(--navy);
  margin-bottom: .5rem;
  position: relative;
  padding-bottom: .6rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.section-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; font-size: .95rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.5rem; }

/* ---- CATEGORII GRID ---- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.category-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.35rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  overflow: hidden;
}
.category-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.category-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.category-card:hover::before { transform: scaleX(1); }
.category-card .cat-icon { font-size: 2rem; line-height: 1; }
.category-card .cat-title { font-weight: 600; color: var(--navy); font-size: .95rem; }
.category-card .cat-count { font-size: .82rem; color: var(--text-muted); }

/* ---- BOOK CARDS GRID ---- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.book-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.book-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.book-card-cover {
  aspect-ratio: 3/4;
  background: #f0ede8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}
.book-card-cover .cover-placeholder {
  color: var(--gold);
  font-size: 3rem;
  opacity: .7;
  margin: auto;
}
.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.book-card-cover embed {
  width: 100%;
  height: 160%;
  flex-shrink: 0;
  object-fit: cover;
}

.book-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.book-card-type {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gold);
  background: var(--navy);
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 3px;
  width: fit-content;
}
.book-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-top: .2rem;
}
.book-card-author { font-size: .83rem; color: var(--text-muted); }
.book-card-meta { font-size: .78rem; color: var(--border); margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--border); color: var(--text-muted); }

/* ---- FILTER PILLS ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter-pill {
  display: inline-block;
  padding: .4rem 1rem;
  border-radius: 30px;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--white);
  transition: .18s;
}
.filter-pill:hover { border-color: var(--navy); color: var(--navy); }
.filter-pill.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---- PAGINA CARTE ---- */
.book-detail { padding: 3rem 0; }
.book-detail-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 3rem;
  align-items: start;
}
.book-detail-cover {
  background: #f0ede8;
  border-radius: var(--radius);
  aspect-ratio: 3/4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.book-detail-cover .cover-placeholder { color: var(--gold); font-size: 5rem; opacity: .6; margin: auto; }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.book-detail-cover embed { width: 100%; height: 160%; flex-shrink: 0; }

.book-detail-info h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: .5rem;
}
.book-meta-table { margin: 1.25rem 0; border-collapse: collapse; width: 100%; }
.book-meta-table th,
.book-meta-table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.book-meta-table th { color: var(--text-muted); font-weight: 500; width: 36%; }
.book-meta-table td { color: var(--text); }

.book-description { margin-top: 1.5rem; }
.book-description h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: .75rem;
}
.book-description p { line-height: 1.9; color: var(--text); }

/* ---- PAGE HEADER ---- */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 0 2rem;
  margin-bottom: 3rem;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--gold);
}
.page-header p { color: rgba(255,255,255,.75); margin-top: .3rem; }
.breadcrumb { font-size: .83rem; color: rgba(255,255,255,.55); margin-bottom: .75rem; }
.breadcrumb a { color: rgba(255,255,255,.65); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }

/* ---- CONTACT ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .4rem; font-size: .9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .95rem;
  background: var(--white);
  color: var(--text);
  transition: border-color .18s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
}
.form-group textarea { resize: vertical; min-height: 140px; }

/* ---- FLASH MESSAGES ---- */
.flash { padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.8);
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr;
  gap: 3rem;
  padding: 3rem 0 2rem;
}
.footer-logo-wrap {
  display: inline-block;
  background: #fff;
  border-radius: 8px;
  padding: .4rem .7rem;
  margin-bottom: .75rem;
}
.footer-logo-wrap img { height: 44px; width: auto; display: block; }
/* Fallback text logo in footer */
.footer-logo-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: .08em;
  display: block;
  margin-bottom: .6rem;
}
.site-footer p { font-size: .88rem; line-height: 1.7; }
.site-footer strong { color: var(--gold); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: .6rem; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.site-footer ul a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .88rem; transition: color .18s; }
.site-footer ul a:hover { color: var(--gold); }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1rem 0;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}
.footer-bottom a { color: rgba(255,255,255,.45); text-decoration: none; }
.footer-bottom a:hover { color: var(--gold); }

/* ---- COOKIE BANNER ---- */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  background: var(--navy-dark);
  color: rgba(255,255,255,.92);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  border: 1px solid rgba(232,204,126,.25);
  max-width: 920px;
  margin: 0 auto;
  animation: cookieUp .4s ease;
}
@keyframes cookieUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 1.5rem;
  flex-wrap: wrap;
}
.cookie-text { flex: 1; min-width: 240px; }
.cookie-text strong { color: var(--gold); font-size: .95rem; display: block; margin-bottom: .2rem; }
.cookie-text p { font-size: .85rem; line-height: 1.55; color: rgba(255,255,255,.8); margin: 0; }
.cookie-text a { color: var(--gold-light); }
.cookie-actions { display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }
.cookie-actions .cookie-details { padding: .55rem 1.1rem; }

/* ---- LEGAL / PROSE PAGES ---- */
.legal-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 0 4rem;
}
.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--navy);
  margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--bg);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 1.1rem;
  color: var(--navy);
  margin: 1.5rem 0 .5rem;
}
.legal-content p { margin-bottom: 1rem; line-height: 1.8; color: var(--text); }
.legal-content ul { margin: 0 0 1rem 1.5rem; line-height: 1.8; }
.legal-content li { margin-bottom: .4rem; }
.legal-content a { color: var(--navy); }
.legal-updated {
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
  padding: .75rem 1rem;
  background: var(--white);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}
.legal-content table.legal-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .9rem; }
.legal-content table.legal-table th,
.legal-content table.legal-table td { border: 1px solid var(--border); padding: .6rem .8rem; text-align: left; }
.legal-content table.legal-table th { background: var(--navy); color: #fff; font-weight: 600; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.05rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .book-detail-grid { grid-template-columns: 1fr; }
  .book-detail-cover { max-width: 360px; margin: 0 auto; aspect-ratio: 3/4; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 660px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 76px;
    left: 0; right: 0;
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: .75rem 1rem;
    gap: .1rem;
    box-shadow: 0 8px 24px rgba(26,58,107,.12);
  }
  .site-nav.open { display: flex; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(26,58,107,.04);
    border-radius: var(--radius);
    margin-top: .2rem;
    padding: .2rem 0;
  }
  .nav-dropdown-menu a { color: var(--navy) !important; }
  .nav-dropdown-menu a:hover { background: rgba(26,58,107,.06); color: var(--navy-dark) !important; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .header-inner { position: relative; }
}
