/*
 * blog.css — Styles for single post pages (single.php)
 * Scoped under .gillmore-single to avoid Storefront conflicts.
 * Compiled separately and enqueued on is_single() only.
 *
 * @package GillmoreAquatics
 */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --blog-primary:           #C62828;
  --blog-primary-dark:      #8e0000;
  --blog-surface:           #f9f9f9;
  --blog-surface-low:       #f3f3f3;
  --blog-surface-container: #eeeeee;
  --blog-on-surface:        #1a1c1c;
  --blog-secondary:         #4c616c;
  --blog-outline:           #e4beba;
  --blog-tertiary:          #005f7b;
  --blog-error:             #ba1a1a;
  --blog-font-headline:     'Manrope', sans-serif;
  --blog-font-body:         'Inter', sans-serif;
  --blog-radius:            0.75rem;
  --blog-radius-lg:         1rem;
}

/* ── Hero ────────────────────────────────────────────────────── */
.gillmore-single__hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  background: #111 center / cover no-repeat;
  overflow: hidden;
}

.gillmore-single__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,0,0,.88) 0%, rgba(10,0,0,.35) 55%, rgba(0,0,0,.1) 100%);
}

.gillmore-single__hero-inner {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.gillmore-single__cat-badge {
  display: inline-block;
  padding: .3rem .9rem;
  border-radius: 9999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  font-family: var(--blog-font-body);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

.gillmore-single__title {
  font-family: var(--blog-font-headline) !important;
  font-weight: 900 !important;
  font-size: clamp(1.85rem, 4vw, 3rem) !important;
  line-height: 1.15 !important;
  color: #fff !important;
  margin: 0 0 1rem !important;
  letter-spacing: -.02em;
}

.gillmore-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  color: rgba(255,255,255,.7);
}

.gillmore-single__meta-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--blog-font-body);
  font-size: .8rem;
}

.gillmore-single__meta-item .material-symbols-outlined {
  font-size: 1rem;
}

/* ── Body layout ─────────────────────────────────────────────── */
.gillmore-single__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

@media (min-width: 1024px) {
  .gillmore-single__body {
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
    padding: 3rem 2rem 5rem;
  }
}

/* ── Article ─────────────────────────────────────────────────── */
.gillmore-single__article {
  min-width: 0;
}

/* ── Inline TOC (inside article, shown on mobile / tablet) ───── */
.gillmore-toc {
  background: #fff5f5;
  border: 1px solid #f5c6c4;
  border-radius: var(--blog-radius);
  padding: .65rem 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .gillmore-toc {
    display: none;
  }
}

/* Collapsible toggle on mobile */
.gillmore-toc__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--blog-font-headline);
  font-weight: 700;
  font-size: .82rem;
  color: var(--blog-primary);
}

.gillmore-toc__toggle-left {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.gillmore-toc__toggle .material-symbols-outlined {
  font-size: .95rem;
}

.gillmore-toc__chevron {
  font-size: .95rem !important;
  transition: transform .2s ease;
}

.gillmore-toc.is-open .gillmore-toc__chevron {
  transform: rotate(180deg);
}

.gillmore-toc__list {
  list-style: none !important;
  margin: .5rem 0 0 !important;
  padding: 0 !important;
  display: none;
  flex-direction: column;
  gap: 0;
}

.gillmore-toc.is-open .gillmore-toc__list {
  display: flex;
}

.gillmore-toc__item {
  margin: 0 !important;
}

.gillmore-toc__link {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--blog-font-body);
  font-size: .78rem;
  font-weight: 500;
  color: #3d2020;
  text-decoration: none;
  padding: .3rem 0;
  border-bottom: 1px solid rgba(198,40,40,.08);
  transition: color .2s;
}

.gillmore-toc__item:last-child .gillmore-toc__link {
  border-bottom: none;
}

.gillmore-toc__link:hover {
  color: var(--blog-primary);
}

.gillmore-toc__dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(198,40,40,.4);
  flex-shrink: 0;
  transition: background .2s;
}

.gillmore-toc__link:hover .gillmore-toc__dot {
  background: var(--blog-primary);
}

/* ── Post content typography ─────────────────────────────────── */
.gillmore-single__content {
  font-family: var(--blog-font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--blog-on-surface);
}

.gillmore-single__content h2 {
  font-family: var(--blog-font-headline) !important;
  font-weight: 800 !important;
  font-size: 1.6rem !important;
  line-height: 1.25 !important;
  letter-spacing: -.02em;
  color: var(--blog-on-surface) !important;
  margin: 2.25rem 0 .75rem !important;
}

.gillmore-single__content h3 {
  font-family: var(--blog-font-headline) !important;
  font-weight: 700 !important;
  font-size: 1.2rem !important;
  color: var(--blog-on-surface) !important;
  margin: 1.75rem 0 .6rem !important;
}

.gillmore-single__content p {
  margin-bottom: 1.25rem;
}

.gillmore-single__content a {
  color: var(--blog-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gillmore-single__content a:hover {
  color: var(--blog-primary-dark);
}

.gillmore-single__content ul,
.gillmore-single__content ol {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
}

.gillmore-single__content li {
  margin-bottom: .4rem;
}

.gillmore-single__content img {
  width: 100%;
  border-radius: var(--blog-radius-lg);
  margin: 1.5rem 0;
}

.gillmore-single__content blockquote {
  border-left: 4px solid var(--blog-primary);
  margin: 1.5rem 0;
  padding: .75rem 1.25rem;
  background: #fff5f5;
  border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
  font-style: italic;
  color: var(--blog-secondary);
}

.gillmore-single__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}

.gillmore-single__content table th {
  background: var(--blog-surface-low);
  font-family: var(--blog-font-headline);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .6rem .85rem;
  border-bottom: 2px solid var(--blog-outline);
  text-align: left;
}

.gillmore-single__content table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--blog-outline);
  vertical-align: top;
}

.gillmore-single__content table tr:last-child td {
  border-bottom: none;
}

/* ── Tags ────────────────────────────────────────────────────── */
.gillmore-single__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--blog-outline);
}

.gillmore-single__tags .material-symbols-outlined {
  font-size: 1rem;
  color: var(--blog-secondary);
}

.gillmore-single__tag {
  display: inline-block;
  padding: .3rem .8rem;
  background: var(--blog-surface-low);
  border-radius: 9999px;
  font-family: var(--blog-font-body);
  font-size: .75rem;
  font-weight: 600;
  color: var(--blog-secondary);
  text-decoration: none;
  transition: background .2s, color .2s;
}

.gillmore-single__tag:hover {
  background: #ffe5e3;
  color: var(--blog-primary);
}

/* ── Author box ──────────────────────────────────────────────── */
.gillmore-single__author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--blog-surface-low);
  border-radius: var(--blog-radius-lg);
  padding: 1.25rem;
  margin-top: 2rem;
}

.gillmore-single__author-avatar {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  flex-shrink: 0;
}

.gillmore-single__author-name {
  font-family: var(--blog-font-headline) !important;
  font-weight: 700 !important;
  font-size: .95rem !important;
  margin: 0 0 .3rem !important;
}

.gillmore-single__author-bio {
  font-size: .82rem;
  color: var(--blog-secondary);
  margin: 0 !important;
  line-height: 1.6;
}

/* ── Post navigation ─────────────────────────────────────────── */
.gillmore-single__post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--blog-outline);
}

.gillmore-single__nav-link {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .85rem 1rem;
  background: var(--blog-surface-low);
  border-radius: var(--blog-radius);
  text-decoration: none;
  transition: background .2s;
}

.gillmore-single__nav-link:hover {
  background: #ffe5e3;
}

.gillmore-single__nav-link--next {
  text-align: right;
}

.gillmore-single__nav-dir {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--blog-secondary);
}

.gillmore-single__nav-link--next .gillmore-single__nav-dir {
  justify-content: flex-end;
}

.gillmore-single__nav-title {
  font-family: var(--blog-font-headline);
  font-weight: 700;
  font-size: .85rem;
  color: var(--blog-on-surface);
  line-height: 1.35;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.gillmore-single__sidebar {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  /* On mobile the sidebar drops below the article */
}

@media (max-width: 1023px) {
  .gillmore-single__sidebar {
    position: static;
  }
}

/* ── Sidebar card (shared) ───────────────────────────────────── */
.gillmore-sidebar-card {
  background: #fff;
  border: 1px solid var(--blog-outline);
  border-radius: var(--blog-radius-lg);
  padding: 1.1rem 1.25rem;
}

.gillmore-sidebar-card__header {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--blog-font-headline);
  font-weight: 700;
  font-size: .9rem;
  color: var(--blog-on-surface);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--blog-outline);
}

.gillmore-sidebar-card__header .material-symbols-outlined {
  font-size: 1.05rem;
  color: var(--blog-primary);
}

/* ── Sidebar TOC ─────────────────────────────────────────────── */
.gillmore-sidebar-toc__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.gillmore-sidebar-toc__item {
  margin: 0 !important;
}

.gillmore-sidebar-toc__item--h3 {
  padding-left: .85rem;
}

.gillmore-sidebar-toc__link {
  display: block;
  font-family: var(--blog-font-body);
  font-size: .8rem;
  font-weight: 500;
  color: #4a3030;
  text-decoration: none;
  padding: .3rem .1rem;
  border-radius: .25rem;
  transition: color .15s, background .15s;
  line-height: 1.45;
}

.gillmore-sidebar-toc__link:hover,
.gillmore-sidebar-toc__link.is-active {
  color: var(--blog-primary);
  background: rgba(198,40,40,.06);
  padding-left: .4rem;
}

/* ── Quick Parameter Card ────────────────────────────────────── */
.gillmore-param-card {
  background: #fff8f7 !important;
  border-color: #f5c6c4 !important;
}

.gillmore-param-card .gillmore-sidebar-card__header {
  color: var(--blog-primary);
}

.gillmore-param-card__table {
  width: 100%;
  border-collapse: collapse;
}

.gillmore-param-card__row:not(:last-child) td {
  border-bottom: 1px solid #f5c6c4;
}

.gillmore-param-card__label {
  font-family: var(--blog-font-body);
  font-size: .78rem;
  color: var(--blog-secondary);
  padding: .45rem 0;
}

.gillmore-param-card__value {
  font-family: var(--blog-font-headline);
  font-weight: 700;
  font-size: .82rem;
  color: var(--blog-on-surface);
  text-align: right;
  padding: .45rem 0;
}

/* ── Scroll-spy active state (JS-driven) ─────────────────────── */
.gillmore-sidebar-toc__link.is-active {
  color: var(--blog-primary) !important;
  font-weight: 700;
}