/* ==========================================================
   THEME: Sidebar Ink — inspired by Pigra's split-panel DNA
   ========================================================== */

/* --- CSS Variables --- */
:root {
  --c-dark: #1a1a1a;
  --c-dark-soft: #232323;
  --c-primary: #c0392b;
  --c-primary-hover: #a93226;
  --c-light: #f7f5f2;
  --c-light-alt: #edeae5;
  --c-body: #555;
  --c-heading: #1a1a1a;
  --c-white: #fff;
  --c-border: rgba(0,0,0,.08);

  --ff-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-heading: Georgia, "Times New Roman", Times, serif;
  --ff-cursive: "Segoe Script", "Apple Chancery", "Comic Sans MS", cursive;

  --sidebar-w: 15%;
  --gap-section: 60px;
  --gap-section-sm: 28px;
  --max-content: 1200px;
  --radius-sm: 3px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.72;
  color: var(--c-body);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color .3s; }
a:hover { color: var(--c-primary-hover); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--ff-heading);
  color: var(--c-heading);
  line-height: 1.25;
  font-weight: 700;
}

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

/* === SPLIT-PANEL LAYOUT (the core Pigra DNA) === */
.sp-section {
  position: relative;
  border-bottom: 1px solid var(--c-border);
}

/* Dark left bar — via pseudo-element like Pigra */
@media (min-width: 992px) {
  .sp-section::before {
    content: "";
    position: absolute;
    width: var(--sidebar-w);
    height: 100%;
    top: 0; left: 0;
    background: var(--c-dark);
    z-index: 0;
  }
}

.sp-section__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  z-index: 1;
}

@media (min-width: 992px) {
  .sp-section__inner {
    grid-template-columns: 25% 75%;
  }
}

/* --- Sidebar label column --- */
.sp-section__label {
  background: var(--c-dark);
  padding: var(--gap-section-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 992px) {
  .sp-section__label {
    padding: var(--gap-section) var(--gap-section) var(--gap-section) 0;
  }
}

.sp-section__label .sub-title {
  font-family: var(--ff-cursive);
  font-size: 1.15rem;
  color: rgba(255,255,255,.55);
  margin-bottom: .35rem;
  font-weight: 400;
}

.sp-section__label h2 {
  font-family: var(--ff-heading);
  color: var(--c-white);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  margin: 0;
  line-height: 1.3;
}

/* --- Content column --- */
.sp-section__content {
  padding: var(--gap-section-sm);
}

@media (min-width: 992px) {
  .sp-section__content {
    padding: var(--gap-section);
  }
}


/* ==========================================================
   HEADER / NAV
   ========================================================== */
.site-header {
  position: relative;
  border-bottom: 1px solid var(--c-border);
  z-index: 100;
}

@media (min-width: 992px) {
  .site-header::before {
    content: "";
    position: absolute;
    width: var(--sidebar-w);
    height: 100%;
    top: 0; left: 0;
    background: var(--c-dark);
    z-index: 0;
  }
}

.site-header__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.site-header__brand {
  background: var(--c-dark);
  padding: 18px var(--gap-section-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

@media (min-width: 992px) {
  .site-header__brand {
    min-width: 25%;
    padding: 22px var(--gap-section) 22px 0;
  }
}

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

.site-header__brand-name {
  font-family: var(--ff-heading);
  font-size: 1.3rem;
  color: var(--c-white);
  font-weight: 700;
  letter-spacing: .02em;
}

/* Desktop nav */
.site-nav { display: none; }

@media (min-width: 992px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: 0;
    padding-right: 20px;
  }
  .site-nav a {
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-heading);
    padding: 10px 18px;
    border-left: 1px solid var(--c-border);
    transition: color .3s, background .3s;
  }
  .site-nav a:hover {
    color: var(--c-primary);
    background: var(--c-light);
  }
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none; border: none;
  cursor: pointer;
  z-index: 200;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--c-heading);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 992px) {
  .hamburger { display: none; }
}

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--c-dark);
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}

.mobile-nav.is-open { opacity: 1; pointer-events: auto; }

.mobile-nav a {
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  color: rgba(255,255,255,.75);
  padding: 12px 20px;
  transition: color .25s;
}

.mobile-nav a:hover { color: var(--c-white); }


/* ==========================================================
   HERO  (split-panel, editorial)
   ========================================================== */
.hero { border-bottom: 1px solid var(--c-border); }

.hero .sp-section__label {
  padding-bottom: var(--gap-section);
}

.hero .sp-section__label h1 {
  font-family: var(--ff-heading);
  color: var(--c-white);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: .6rem;
}

.hero .sp-section__label .hero-subtitle {
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: 1.4rem;
}

.hero .sp-section__label .hero-subtitle p { margin: 0; }

.hero-cta {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-white);
  background: var(--c-primary);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  transition: background .3s;
}

.hero-cta:hover { background: var(--c-primary-hover); color: var(--c-white); }

/* Hero content side — featured posts tease */
.hero-featured {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-featured__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
}

.hero-featured__item:last-child { border-bottom: none; padding-bottom: 0; }

@media (min-width: 600px) {
  .hero-featured__item { grid-template-columns: 200px 1fr; }
}

.hero-featured__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--c-light-alt);
  border-radius: var(--radius-sm);
}

.hero-featured__meta {
  font-size: .78rem;
  color: var(--c-body);
  margin-bottom: .3rem;
}

.hero-featured__title {
  font-family: var(--ff-heading);
  font-size: 1.1rem;
  color: var(--c-heading);
  line-height: 1.35;
  margin-bottom: .35rem;
}

.hero-featured__title a { color: inherit; }
.hero-featured__title a:hover { color: var(--c-primary); }

.hero-featured__excerpt {
  font-size: .88rem;
  color: var(--c-body);
  line-height: 1.6;
}

.hero-featured__excerpt p { margin: 0; }


/* ==========================================================
   TOPICS
   ========================================================== */
.topics-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.topic-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--c-border);
  transition: background .3s;
}

.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--c-light); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }

@media (min-width: 768px) {
  .topic-row {
    grid-template-columns: 220px 1fr;
    align-items: baseline;
    gap: 32px;
  }
}

.topic-row__name {
  font-family: var(--ff-heading);
  font-size: 1.15rem;
  color: var(--c-heading);
  margin-bottom: .25rem;
}

.topic-row__desc {
  font-size: .9rem;
  color: var(--c-body);
  line-height: 1.65;
}

.topic-row__desc p { margin: 0; }


/* ==========================================================
   LATEST POSTS
   ========================================================== */
.posts-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--c-border);
  transition: background .3s;
}

.post-card:last-child { border-bottom: none; }

@media (min-width: 768px) {
  .post-card { grid-template-columns: 260px 1fr; gap: 28px; }
}

.post-card:hover { background: var(--c-light); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }

.post-card__img-wrap {
  position: relative;
  width: 100%;
  height: 175px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--c-light-alt);
}

.post-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.post-card:hover .post-card__img-wrap img {
  transform: rotate(-2deg) scale(1.05);
}

.post-card__body { display: flex; flex-direction: column; justify-content: center; }

.post-card__date {
  font-size: .78rem;
  color: var(--c-body);
  margin-bottom: .35rem;
  font-family: var(--ff-body);
}

.post-card__title {
  font-family: var(--ff-heading);
  font-size: 1.2rem;
  color: var(--c-heading);
  line-height: 1.3;
  margin-bottom: .45rem;
}

.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--c-primary); }

.post-card__excerpt {
  font-size: .88rem;
  color: var(--c-body);
  line-height: 1.65;
}

.post-card__excerpt p { margin: 0; }

.post-card__link {
  margin-top: .6rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--c-primary);
  letter-spacing: .03em;
}

.post-card__link:hover { color: var(--c-primary-hover); }


/* ==========================================================
   FAQ
   ========================================================== */
.faq-list { display: flex; flex-direction: column; gap: 0; }

.faq-item {
  border-bottom: 1px solid var(--c-border);
  padding: 20px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-family: var(--ff-heading);
  font-size: 1.05rem;
  color: var(--c-heading);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
  line-height: 1.4;
}

.faq-question::after {
  content: "+";
  font-family: var(--ff-body);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--c-body);
  flex-shrink: 0;
  transition: transform .3s;
}

.faq-item.is-open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .4s ease;
  font-size: .9rem;
  color: var(--c-body);
  line-height: 1.7;
}

.faq-item.is-open .faq-answer {
  max-height: 600px;
  padding-top: 12px;
}

.faq-answer p { margin: 0 0 .6rem; }
.faq-answer p:last-child { margin-bottom: 0; }


/* ==========================================================
   BLOG INDEX
   ========================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 768px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
}

.blog-card {
  padding: 24px;
  border-bottom: 1px solid var(--c-border);
  transition: background .3s;
}

@media (min-width: 768px) {
  .blog-card { border-right: 1px solid var(--c-border); }
  .blog-card:nth-child(2n) { border-right: none; }
}

.blog-card:hover { background: var(--c-light); }

.blog-card__img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--c-light-alt);
}

.blog-card__date {
  font-size: .78rem;
  color: var(--c-body);
  margin-bottom: .3rem;
}

.blog-card__title {
  font-family: var(--ff-heading);
  font-size: 1.1rem;
  color: var(--c-heading);
  line-height: 1.3;
  margin-bottom: .4rem;
}

.blog-card__title a { color: inherit; }
.blog-card__title a:hover { color: var(--c-primary); }

.blog-card__excerpt {
  font-size: .88rem;
  color: var(--c-body);
  line-height: 1.6;
}

.blog-card__excerpt p { margin: 0; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px 0 8px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--c-heading);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  transition: background .3s, color .3s;
}

.pagination a:hover { background: var(--c-light); color: var(--c-primary); }
.pagination a.active,
.pagination span.active {
  background: var(--c-dark);
  color: var(--c-white);
  border-color: var(--c-dark);
}


/* ==========================================================
   SINGLE POST
   ========================================================== */
.post-hero__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-bottom: 28px;
  border-radius: var(--radius-sm);
}

.post-hero__title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: .4rem;
}

.post-hero__date {
  font-size: .82rem;
  color: var(--c-body);
  margin-bottom: 1rem;
}

.post-hero__excerpt {
  font-size: 1.05rem;
  color: var(--c-body);
  line-height: 1.7;
  border-left: 3px solid var(--c-primary);
  padding-left: 20px;
  margin-bottom: 2rem;
}

.post-hero__excerpt p { margin: 0; }

/* Content HTML styles */
.content-html h2 {
  font-size: 1.4rem;
  margin: 2rem 0 .8rem;
}

.content-html h3 {
  font-size: 1.15rem;
  margin: 1.6rem 0 .6rem;
}

.content-html p {
  margin: 0 0 1rem;
  line-height: 1.75;
}

.content-html ul,
.content-html ol {
  margin: 0 0 1rem 1.4rem;
  line-height: 1.75;
}

.content-html blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 12px 20px;
  margin: 1.2rem 0;
  color: var(--c-heading);
  font-style: italic;
  background: var(--c-light);
}

.content-html img {
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.content-html a { color: var(--c-primary); text-decoration: underline; }


/* ==========================================================
   PAGE
   ========================================================== */
.page-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1.2rem;
}


/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: var(--c-dark);
  color: rgba(255,255,255,.55);
  font-size: .88rem;
}

.site-footer__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 48px var(--gap-section-sm) 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 56px 40px 40px;
  }
}

.site-footer__brand-name {
  font-family: var(--ff-heading);
  font-size: 1.2rem;
  color: var(--c-white);
  margin-bottom: .5rem;
}

.site-footer__tagline {
  font-size: .85rem;
  line-height: 1.6;
}

.site-footer h4 {
  font-family: var(--ff-heading);
  font-size: .95rem;
  color: var(--c-white);
  margin-bottom: .7rem;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer nav a {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  transition: color .25s;
}

.site-footer nav a:hover { color: var(--c-white); }

.site-footer__contact a {
  color: rgba(255,255,255,.55);
}

.site-footer__contact a:hover { color: var(--c-white); }

.site-footer__copy {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 20px var(--gap-section-sm);
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.35);
}

@media (min-width: 768px) {
  .site-footer__copy { padding: 20px 40px; }
}


/* ==========================================================
   BACK TO TOP
   ========================================================== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px; height: 42px;
  background: var(--c-dark);
  color: var(--c-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, background .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--c-primary); }


/* ==========================================================
   FOCUS STYLES
   ========================================================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
