/*
Theme Name: Culture Line
Description: News/magazine theme for thecultureline.com — centered logo header, featured slider, recent grid, ranked Top News with week/month/year tabs.
Version: 1.0
Text Domain: cultureline
*/

:root {
  --blue: #1e88e5;
  --blue-dark: #1565c0;
  --text: #2b2b2b;
  --muted: #6b6b6b;
  --bg: #f9f5f0;
  --card: #ffffff;
  --line: #e6e2dc;
  --footer-bg: #f1f1f1;
  --radius: 16px;
  --max-width: 1340px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Header ---------- */
.site-header { background: #fff; }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 108px;
  border-bottom: 1px solid var(--line);
}
.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: inline-block;
  padding: 6px 0;
  color: var(--blue);
  font-size: 17px;
  font-weight: 700;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--blue-dark); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--text);
  border-bottom-color: var(--blue);
}

.site-branding { justify-self: center; }
.site-logo {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  color: var(--blue);
}
.logo-text {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
  white-space: nowrap;
}
.logo-mark { margin-bottom: 6px; }
.custom-logo { max-height: 60px; width: auto; }

.header-search {
  justify-self: end;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 340px;
  background: #f4f4f4;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  padding: 0 8px 0 18px;
  height: 52px;
}
.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}
.header-search input:focus { outline: none; }
.header-search:focus-within { border-color: var(--blue); }
.header-search button {
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
}

/* ---------- Sections ---------- */
.content-wrap { padding: 50px 0 80px; }
.home-section { margin-bottom: 80px; }
.home-section:last-child { margin-bottom: 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.section-title {
  margin: 0;
  padding-left: 14px;
  border-left: 5px solid var(--blue);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  color: #333;
}
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-size: 24px;
  font-weight: 700;
}
.view-all:hover { color: var(--blue-dark); }

.eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.post-date { font-size: 13px; color: #555; margin-top: 6px; }
.mini-rule {
  display: block;
  width: 32px;
  height: 2px;
  background: #e1e1e1;
  margin: 12px 0 0;
}

/* ---------- Featured slider ---------- */
.featured-track { position: relative; }
.featured-card {
  display: none;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border: 1px solid #222;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 50px -30px rgba(0,0,0,0.35);
  min-height: 460px;
  animation: cl-fade .45s ease;
}
.featured-card.is-active { display: grid; }
@keyframes cl-fade { from { opacity: 0; } to { opacity: 1; } }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 24px;
}
.featured-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.featured-title a:hover { color: var(--blue); }
.featured-excerpt {
  margin-top: 24px;
  font-size: 15.5px;
  line-height: 1.65;
  color: #333;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden;
}
.read-more {
  margin-top: 26px;
  align-self: flex-start;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.read-more:hover { color: var(--blue-dark); }

.slider-progress {
  display: flex;
  margin-top: 120px;
  height: 6px;
  box-shadow: 0 18px 30px -12px rgba(0,0,0,0.18);
  background: #fff;
}
.slider-dot {
  flex: 1;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  position: relative;
}
.slider-dot::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 6px;
  width: 6px;
  background: var(--blue);
  opacity: 0;
  transition: width .3s ease, opacity .3s ease;
}
.slider-dot.is-active::after { opacity: 1; width: 100%; }
.slider-dot:first-child.is-active::after { width: 100%; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0,0,0,0.3); }
.card-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 22px 22px; }
.card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.card-title a:hover { color: var(--blue); }

/* ---------- Top news ---------- */
.top-tabs { display: flex; gap: 30px; }
.top-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 4px 0 8px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  color: #6b6b6b;
  cursor: pointer;
}
.top-tab.is-active { color: var(--text); border-bottom-color: var(--blue); }
.rank-grid {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rank-grid.is-active { display: grid; }
.rank-card {
  display: grid;
  grid-template-columns: 42px 108px 1fr;
  gap: 20px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 30px;
}
.rank-num { color: var(--blue); font-size: 30px; font-weight: 400; text-align: center; }
.rank-thumb { display: block; width: 108px; height: 76px; border-radius: 8px; overflow: hidden; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.rank-title a:hover { color: var(--blue); }

/* ---------- Single / page ---------- */
.article-card {
  max-width: 860px;
  margin: 0 auto 60px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 44px 52px;
}
.article-title { margin: 4px 0 0; font-size: 34px; line-height: 1.25; font-weight: 900; }
.article-thumb { margin: 28px 0 8px; border-radius: 12px; overflow: hidden; }
.article-thumb img { width: 100%; height: auto; }
.post-content { margin-top: 24px; font-size: 17.5px; line-height: 1.8; color: #333; }
.post-content a { color: var(--blue); text-decoration: underline; }
.post-content img { height: auto; border-radius: 8px; }
.post-content h2, .post-content h3 { line-height: 1.3; margin: 1.6em 0 .6em; }

.share-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.share-row a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.share-row a:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.author-box {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 22px;
  background: var(--bg);
  border-radius: 12px;
}
.author-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.author-name { font-weight: 900; margin-bottom: 6px; }
.author-bio { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- Archive ---------- */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}
.sidebar-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 28px;
}
.sidebar-title {
  margin: 0 0 16px;
  padding-left: 10px;
  border-left: 4px solid var(--blue);
  font-size: 17px;
  text-transform: uppercase;
}
.sidebar-rank { list-style: none; margin: 0; padding: 0; }
.sidebar-rank li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}
.sidebar-rank li:last-child { border-bottom: none; }
.sidebar-rank .rank-num { font-size: 22px; line-height: 1; }
.sidebar-rank a:hover { color: var(--blue); }
.sidebar-links { list-style: none; margin: 0; padding: 0; }
.sidebar-links li { border-bottom: 1px solid var(--line); }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a { display: block; padding: 10px 0; color: var(--blue); font-weight: 700; }

.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 44px; }
.page-numbers {
  min-width: 42px; height: 42px;
  padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card);
  border-radius: 10px;
  font-weight: 700;
  color: var(--blue);
}
.page-numbers.current { background: var(--blue); color: #fff; }
.empty-note { font-size: 17px; }
.empty-note a { color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  padding: 28px 0 30px;
  text-align: center;
}
.footer-nav {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 13px;
}
.footer-nav a { color: #333; }
.footer-nav a:hover { color: var(--blue); }
.footer-copyright { font-size: 14px; color: #222; }

/* ---------- Mobile drawer ---------- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}
.mobile-menu-toggle svg { display: block; }
.mobile-drawer, .mobile-drawer-overlay { display: none; }

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-card { padding: 20px; grid-template-columns: 32px 90px 1fr; gap: 14px; }
  .rank-thumb { width: 90px; height: 66px; }
  .main-nav ul { gap: 18px; }
}

@media (max-width: 960px) {
  .header-inner { grid-template-columns: 44px 1fr 44px; min-height: 72px; gap: 8px; }
  .main-nav, .header-search { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .logo-text { font-size: 26px; }
  .logo-mark { width: 30px; height: 24px; margin-bottom: 4px; }

  .featured-card { grid-template-columns: 1fr; min-height: 0; }
  .featured-thumb { aspect-ratio: 16/10; }
  .featured-body { padding: 22px; }
  .featured-title { font-size: 21px; }
  .featured-excerpt { margin-top: 16px; -webkit-line-clamp: 4; }
  .slider-progress { margin-top: 26px; }

  .rank-grid { grid-template-columns: 1fr; gap: 16px; }
  .archive-layout { grid-template-columns: 1fr; }

  .mobile-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 998;
  }
  .mobile-drawer-overlay[hidden] { display: none; }
  .mobile-drawer-close {
    position: absolute;
    top: 6px; right: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 6px;
    line-height: 1;
  }
  .mobile-drawer-close svg { display: block; }
  .mobile-drawer {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 77%;
    max-width: 340px;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform .3s ease;
    visibility: hidden;
    z-index: 999;
    padding-top: 34px;
  }
  body.mobile-drawer-open { overflow: hidden; }
  body.mobile-drawer-open .mobile-drawer { transform: translateX(0); visibility: visible; }
  body.mobile-drawer-open .mobile-drawer-overlay { opacity: 1; }
  .mobile-search {
    display: flex;
    margin: 0 14px 18px;
    background: #f4f4f4;
    border: 1px solid #dcdcdc;
    border-radius: 999px;
    padding: 0 6px 0 16px;
    height: 46px;
    align-items: center;
  }
  .mobile-search input {
    flex: 1; min-width: 0;
    border: none; background: transparent;
    font-size: 16px; font-family: inherit; color: var(--text);
  }
  .mobile-search input:focus { outline: none; }
  .mobile-search button {
    background: none; border: none; color: #111;
    padding: 8px; cursor: pointer; display: inline-flex;
  }
  .mobile-menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e6e6e6; }
  .mobile-menu li { border-bottom: 1px solid #e6e6e6; }
  .mobile-menu a {
    display: block;
    padding: 0 16px;
    line-height: 56px;
    color: var(--blue);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .mobile-menu .current-menu-item > a { color: var(--text); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .content-wrap { padding: 30px 0 50px; }
  .home-section { margin-bottom: 50px; }
  .section-title { font-size: 22px; }
  .view-all { font-size: 17px; }
  .top-tabs { gap: 18px; }
  .top-tab { font-size: 16px; }
  .card-grid, .card-grid-2 { grid-template-columns: 1fr; gap: 20px; }
  .rank-card { grid-template-columns: 28px 80px 1fr; padding: 16px; gap: 12px; }
  .rank-num { font-size: 24px; }
  .rank-thumb { width: 80px; height: 60px; }
  .rank-title { font-size: 15.5px; }
  .article-card { padding: 26px 20px; }
  .article-title { font-size: 26px; }
  .post-content { font-size: 17px; }
}
