/* ============================================================
   THEME: Teal Folio — SlashSEO Portal Theme
   Inspired by Catalog-Z visual DNA
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --primary: #009999;
  --primary-dark: #086969;
  --primary-light: #33cccc;
  --accent-1: #33CCFF;
  --accent-2: #FF6666;
  --accent-3: #33CC66;
  --accent-4: #CC66CC;
  --secondary: #CC6699;
  --text-dark: #333333;
  --text-mid: #666666;
  --text-gray: #999999;
  --text-light: #CCCCCC;
  --bg-white: #ffffff;
  --bg-off: #f8f8f8;
  --bg-gray: #EEEEEE;
  --bg-dark-overlay: #030c17;
  --max-width: 1770px;
  --max-width-sm: 1050px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
  --transition: all 0.3s ease;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-mid);
  line-height: 1.8;
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

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

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

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

p { margin-bottom: 1rem; }

/* --- Utilities --- */
.container-wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 30px;
}

.container-narrow {
  max-width: var(--max-width-sm);
  margin: 0 auto;
  padding: 0 30px;
}

.text-primary { color: var(--primary) !important; }
.text-gray { color: var(--text-gray); }
.text-gray-light { color: var(--text-light); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Skip Navigation --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 10px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  z-index: 9999;
  border-radius: 0 0 4px 4px;
  font-size: 0.9rem;
}
.skip-nav:focus {
  top: 0;
  color: #fff;
}

/* ============================================================
   HEADER / NAVIGATION
   DNA: Flat navbar, brand left, links right, colored bottom
   borders per link (multi-color accent system)
   ============================================================ */

.site-header {
  position: relative;
  z-index: 100;
  background: var(--bg-white);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #3399CC;
  font-weight: 400;
  text-decoration: none;
}
.site-brand:hover { color: #3399CC; }

.site-brand img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  color: var(--text-mid);
  font-size: 1.1rem;
  padding-bottom: 6px;
  border-bottom: 4px solid transparent;
  transition: var(--transition);
}

.nav-links li:nth-child(4n+1) a:hover,
.nav-links li:nth-child(4n+1) a.active { border-color: var(--accent-1); }
.nav-links li:nth-child(4n+2) a:hover,
.nav-links li:nth-child(4n+2) a.active { border-color: var(--accent-2); }
.nav-links li:nth-child(4n+3) a:hover,
.nav-links li:nth-child(4n+3) a.active { border-color: var(--accent-3); }
.nav-links li:nth-child(4n) a:hover,
.nav-links li:nth-child(4n) a.active { border-color: var(--accent-4); }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text-mid);
  transition: var(--transition);
}
.hamburger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO SECTION
   DNA: Full-width image background with minimal overlay content,
   parallax feel, dark overlay
   ============================================================ */

.hero {
  position: relative;
  min-height: 260px;
  background-color: var(--bg-dark-overlay);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(3,12,23,0.7) 0%, rgba(0,153,153,0.25) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 60px 50px;
  color: #fff;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
  margin-bottom: 28px;
}
.hero-subtitle p { color: rgba(255,255,255,0.82); margin-bottom: 0.5rem; }

.hero-cta {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  padding: 12px 44px 14px;
  font-size: 1.1rem;
  border: none;
  border-radius: 5px;
  transition: var(--transition);
}
.hero-cta:hover {
  background-color: var(--primary-dark);
  color: #fff;
}

/* ============================================================
   SECTION SPACING
   DNA: Generous, non-uniform margins (60, 74, 90px)
   ============================================================ */

.section { padding: 60px 0; }
.section--tight { padding: 40px 0; }
.section--spacious { padding: 90px 0; }
.section-title {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 40px;
}

/* ============================================================
   LATEST POSTS — GRID WITH FIGURE HOVER EFFECT
   DNA: 4-col grid, figure with dark bg overlay on hover,
   border frame reveal + title scale animation (effect-ming)
   ============================================================ */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 50px;
}

.post-card { margin-bottom: 10px; }

.post-card-figure {
  position: relative;
  overflow: hidden;
  background: var(--bg-dark-overlay);
  cursor: pointer;
  aspect-ratio: 4/3;
}

.post-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.35s ease;
}

.post-card-figure .figure-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em;
  color: #fff;
  text-transform: uppercase;
  z-index: 2;
}

.post-card-figure .figure-overlay::before {
  content: '';
  position: absolute;
  top: 20px; right: 20px; bottom: 20px; left: 20px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 20px rgba(255,255,255,0.15);
  opacity: 0;
  transform: scale3d(1.4, 1.4, 1);
  transition: opacity 0.35s, transform 0.35s;
}

.post-card-figure .figure-overlay-title {
  font-size: 1.15em;
  font-weight: 300;
  color: #fff;
  opacity: 0;
  transform: scale(1.5);
  transition: opacity 0.35s, transform 0.35s;
  text-align: center;
  word-spacing: -0.1em;
}

.post-card-figure:hover .figure-overlay::before,
.post-card-figure:hover .figure-overlay-title {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}
.post-card-figure:hover img { opacity: 0.4; }

.post-card-figure a {
  position: absolute;
  inset: 0;
  z-index: 10;
  text-indent: -9999px;
  font-size: 0;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 0.9rem;
}
.post-card-meta .post-date { color: var(--text-light); }
.post-card-meta .post-read-more { color: var(--primary); font-size: 0.85rem; }
.post-card-meta .post-read-more:hover { color: var(--primary-dark); }

/* No-cover fallback */
.post-card-figure--nocover {
  background: linear-gradient(135deg, var(--bg-dark-overlay), #0a2a3c);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-figure--nocover .figure-overlay-title { opacity: 1; transform: none; }
.post-card-figure--nocover .figure-overlay::before { opacity: 0.3; transform: none; }
.post-card-figure--nocover:hover .figure-overlay::before { opacity: 0.7; }

/* post excerpt under cards (used on blog_index, not home) */
.post-card-excerpt {
  color: var(--text-gray);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-top: 6px;
}
.post-card-excerpt p { margin-bottom: 0.3rem; }

/* ============================================================
   TOPICS — CARD LAYOUT
   DNA: Clean blocks with teal text, no heavy borders,
   icon containers with 1px border (#009999),
   light weight headings
   ============================================================ */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

.topic-card {
  padding: 30px 0;
}

.topic-icon {
  width: 80px;
  height: 80px;
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 300;
  font-family: var(--font-heading);
  transition: var(--transition);
}
.topic-card:hover .topic-icon {
  background: var(--primary);
  color: #fff;
}

.topic-card h3 {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 14px;
}

.topic-card .topic-desc {
  color: var(--text-gray);
  font-size: 0.95rem;
  line-height: 1.8;
}
.topic-card .topic-desc p { margin-bottom: 0.4rem; }

/* ============================================================
   FAQ — Expandable with minimal styling
   DNA: Clean, no accordion borders, teal accents, spacious
   ============================================================ */

.faq-list { list-style: none; max-width: 900px; }

.faq-item {
  border-bottom: 1px solid var(--bg-gray);
  padding: 22px 0;
}
.faq-item:last-child { border-bottom: none; }

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-dark);
  font-weight: 400;
  padding: 0;
  gap: 20px;
  line-height: 1.5;
}
.faq-question:hover { color: var(--primary); }
.faq-question:focus { outline: 2px solid var(--primary); outline-offset: 4px; }

.faq-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-gray);
  transition: var(--transition);
}

.faq-item.is-open .faq-toggle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  color: var(--text-gray);
  font-size: 0.95rem;
  line-height: 1.8;
}
.faq-answer p { margin-bottom: 0.5rem; }
.faq-item.is-open .faq-answer {
  max-height: 600px;
  padding-top: 16px;
}

/* ============================================================
   PAGINATION
   DNA: Square paging links, prev/next buttons with teal bg,
   active state same teal
   ============================================================ */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 40px 0 60px;
}

.pagination-pages {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  font-size: 1rem;
  color: var(--text-gray);
  background: var(--bg-gray);
  border-radius: 5px;
  transition: var(--transition);
}
.pagination-link:hover,
.pagination-link.active {
  background: var(--primary);
  color: #fff;
}

.pagination-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 12px 40px 14px;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  transition: var(--transition);
}
.pagination-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}
.pagination-btn--disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================================
   SINGLE POST
   ============================================================ */

.post-single { max-width: 860px; margin: 0 auto; }

.post-header { margin-bottom: 40px; }
.post-header h1 {
  font-size: 2.2rem;
  color: var(--primary);
  font-weight: 300;
  margin-bottom: 12px;
}
.post-date-single {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.post-excerpt-single {
  color: var(--text-gray);
  font-size: 1.05rem;
  line-height: 1.8;
  border-left: 3px solid var(--primary);
  padding-left: 20px;
  margin-bottom: 30px;
}
.post-excerpt-single p { margin-bottom: 0.3rem; }

.post-cover {
  margin-bottom: 40px;
}
.post-cover img { width: 100%; }

.post-content {
  color: var(--text-mid);
  font-size: 1.05rem;
  line-height: 1.9;
}
.post-content h2 { color: var(--primary); font-size: 1.5rem; margin: 36px 0 16px; }
.post-content h3 { color: var(--text-dark); font-size: 1.25rem; margin: 28px 0 12px; }
.post-content p { margin-bottom: 1.2rem; }
.post-content ul, .post-content ol { margin: 0 0 1.2rem 24px; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--primary); border-bottom: 1px solid var(--primary-light); }
.post-content a:hover { color: var(--primary-dark); }
.post-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 12px 24px;
  margin: 24px 0;
  color: var(--text-gray);
  font-style: italic;
}
.post-content img { margin: 20px 0; border-radius: 2px; }

/* ============================================================
   PAGE (static)
   ============================================================ */

.page-single { max-width: 860px; margin: 0 auto; }
.page-single h1 {
  font-size: 2.2rem;
  color: var(--primary);
  font-weight: 300;
  margin-bottom: 30px;
}
.page-content {
  color: var(--text-mid);
  font-size: 1.05rem;
  line-height: 1.9;
}
.page-content h2 { color: var(--primary); font-size: 1.5rem; margin: 36px 0 16px; }
.page-content h3 { color: var(--text-dark); font-size: 1.25rem; margin: 28px 0 12px; }
.page-content p { margin-bottom: 1.2rem; }
.page-content ul, .page-content ol { margin: 0 0 1.2rem 24px; }
.page-content li { margin-bottom: 6px; }
.page-content a { color: var(--primary); border-bottom: 1px solid var(--primary-light); }
.page-content a:hover { color: var(--primary-dark); }

/* ============================================================
   FOOTER
   DNA: Gray background (#EEE), multi-column, teal titles,
   gray text and links, small font, spacious padding
   ============================================================ */

.site-footer {
  background: var(--bg-gray);
  padding: 50px 0 24px;
  color: var(--text-gray);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-title {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 18px;
}

.footer-about p { color: var(--text-gray); font-size: 0.95rem; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links li a {
  color: var(--text-gray);
  font-size: 0.95rem;
}
.footer-links li a:hover { color: var(--primary); }

.footer-contact a { color: var(--text-gray); }
.footer-contact a:hover { color: var(--primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    right: 0;
    background: #fff;
    width: 200px;
    padding: 20px;
    box-shadow: -2px 4px 12px rgba(0,0,0,0.08);
    z-index: 999;
    gap: 0;
  }
  .nav-links.is-open a {
    padding: 10px 0;
    border-bottom: none;
  }

  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .hero-title { font-size: 2rem; }
  .hero-content { padding: 40px 30px; }
}

@media (max-width: 767px) {
  .posts-grid { grid-template-columns: 1fr; max-width: 480px; }
  .topics-grid { grid-template-columns: 1fr; max-width: 480px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .pagination { flex-direction: column; align-items: center; }
  .pagination-pages { justify-content: center; }

  .hero { min-height: 200px; background-attachment: scroll; }
  .hero-title { font-size: 1.6rem; }
  .hero-content { padding: 30px 20px; max-width: 100%; }

  .container-wide, .container-narrow { padding: 0 16px; }
  .site-nav { padding: 14px 16px; }

  .post-header h1, .page-single h1 { font-size: 1.6rem; }
}

@media (max-width: 400px) {
  .pagination-btn { padding: 10px 28px; font-size: 0.9rem; }
}

/* Focus styles for keyboard nav */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   BLOG INDEX — slightly different post grid layout:
   featured first post spanning 2 columns
   ============================================================ */

.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}
.blog-header h1 {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 300;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .hamburger, .hero { display: none; }
  body { color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
}
