/*
Theme Name: tripsofar
Theme URI: https://tripsofar.com
Author: tripsofar
Author URI: https://tripsofar.com
Description: A lightweight, bloat-free, SEO-first travel blog theme built for Core Web Vitals, AdSense revenue, and affiliate conversions (Booking.com, GetYourGuide, Viator, Amazon Associates). Inspired by high-converting single-post layouts with sticky TOC, callout boxes, and a monetization-focused sidebar.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: tripsofar
*/

/* ==========================================================================
   1. CSS VARIABLES / DESIGN TOKENS
   ========================================================================== */
:root {
  /* Brand colors — sampled from the tripsofar logo mark */
  --color-primary: #2e3192;      /* navy — "trip" wordmark, links, headings on hover */
  --color-primary-dark: #21245f;
  --color-accent: #00aeef;       /* cyan — "sofar" wordmark, CTAs, category pills */
  --color-accent-dark: #0090c7;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5a;
  --color-border: #e6e6e6;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-success: #1f9d55;
  --color-dark: #2e3192;         /* brand navy used for top bar / footer surfaces */

  /* Typography */
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Version 1.2 Update: was clamp(1.9rem, 1.6rem + 1.5vw, 2.75rem) — max
     size exceeded the requested 40px/2.5rem ceiling. Tightened range and
     mobile floor so titles scale from ~28px on small phones up to a hard
     40px max on desktop, never larger. */
  --fs-h1: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --fs-h2: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.5vw, 1.5rem);
  --fs-body: 1.0625rem;
  --lh-body: 1.75;

  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --sidebar-width: 320px;
  --gap: 2rem;
  --radius: 10px;
  --radius-sm: 6px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);

  /* Header height, used for scroll-margin so TOC jump links don't hide under sticky header */
  --header-height: 64px;
}

/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  margin: 1.75em 0 0.6em;
  color: var(--color-text);
}
h1 { font-size: var(--fs-h1); line-height: 1.2; margin-top: 0; margin-bottom: 0.45em; }

/* Version 1.3 Update: standard page titles (About, Contact, etc.) now use
   a smaller, dedicated size — a short one-word title like "About" looked
   disproportionately huge at the post-title scale above. 28px mobile floor
   up to a 35px desktop ceiling, matching the requested 1.8rem-2.2rem range.
   .post-header adds specificity so this reliably wins over the generic h1
   rule regardless of source order. */
.post-header .page-title {
  font-size: clamp(1.8rem, 1.65rem + 0.7vw, 2.2rem);
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.4em;
}
h2 { font-size: var(--fs-h2); scroll-margin-top: calc(var(--header-height) + 12px); }
h3 { font-size: var(--fs-h3); scroll-margin-top: calc(var(--header-height) + 12px); }

p { margin: 0 0 1.25em; }

ul, ol { padding-left: 1.4em; }

/* Prevents layout shift: reserve space for focus rings without adding jump */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

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

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ==========================================================================
   3. TOP BAR + HEADER
   ========================================================================== */
.top-bar {
  background: var(--color-dark);
  color: #fff;
  font-size: 0.8rem;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  padding-bottom: 6px;
}
.top-bar__notice { opacity: 0.9; }
.top-bar__notice a { color: #fff; text-decoration: underline; }
.top-bar__social { display: flex; gap: 12px; }
.top-bar__social a { color: #fff; opacity: 0.85; }
.top-bar__social a:hover { opacity: 1; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
}
.site-header .container {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding a {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-branding a span { color: var(--color-accent); }

/* Bundled logo image (theme/images/logo.png), used when no Customizer logo is set */
.site-branding__logo {
  height: 40px;
  width: auto;
  display: block;
}

.main-navigation { flex: 1; }
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  justify-content: center;
}
.main-navigation a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
}
.main-navigation a:hover { color: var(--color-primary); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
}

.btn {
  display: inline-block;
  padding: 0.65em 1.3em;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-accent-dark); color: #fff; white-space: nowrap; }
.btn--primary:hover { background: var(--color-primary); }
.btn__label--short { display: none; }
.btn--outline { background: transparent; border: 1.5px solid var(--color-text); color: var(--color-text); }

.header-search-panel {
  display: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.header-search-panel.is-open { display: block; }
.header-search-panel .container { padding-top: 14px; padding-bottom: 14px; }
.header-search-panel form { display: flex; gap: 8px; }
.header-search-panel input[type="search"] {
  flex: 1;
  padding: 0.6em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

/* Mobile nav toggle */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

@media (max-width: 880px) {
  .main-navigation { position: static; }
  .main-navigation ul {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 20px 16px;
    z-index: 99;
  }
  .main-navigation ul.is-open { display: flex; }
  .main-navigation li { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
  .menu-toggle { display: flex; }
  .btn--outline { display: none; }

  /* Keep logo + search + CTA + hamburger from ever competing for width:
     tighten spacing and drop the CTA to a short label so it always stays
     on one line instead of wrapping and blowing out the header height. */
  .header-actions { gap: 0.4rem; }
  .btn--primary { padding: 0.6em 0.85em; font-size: 0.82rem; }
  .btn__label--full { display: none; }
  .btn__label--short { display: inline; }
  .site-branding__logo { height: 32px; }
}

@media (max-width: 600px) {
  /* Top bar: keep the trending notice + social icons on one line instead
     of wrapping into a cramped two-line stack. */
  .top-bar .container { flex-wrap: nowrap; gap: 0.75rem; }
  .top-bar__notice {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .top-bar__social { flex-shrink: 0; }
}

/* ==========================================================================
   4. HOME PAGE — HERO
   ========================================================================== */
.hero { padding: 2.5rem 0; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.25rem;
}
.hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  color: #fff;
  isolation: isolate;
  min-width: 0;
}
.hero-card:first-child { grid-row: span 1; }
.hero-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
}
.hero-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
  z-index: -1;
}
.hero-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.25rem; }
.hero-card__category {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.hero-card__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  line-height: 1.6;
}
.hero-card__title a {
  color: #0a2540 !important;
  background-color: rgba(186, 230, 253, 0.92); /* light blue highlight */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(186, 230, 253, 0.92);
  text-decoration: none;
}
.hero-card__cta {
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero-card { aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   5. POPULAR DESTINATIONS BAR
   ========================================================================== */
.destinations { padding: 1.5rem 0 2.5rem; border-bottom: 1px solid var(--color-border); }
.destinations__title { font-size: 1.1rem; margin: 0 0 1rem; }
.destinations__row {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.destination-pill {
  flex: 0 0 auto;
  text-align: center;
  width: 96px;
}
.destination-pill__icon {
  display: block;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 8px;
  border: 2px solid var(--color-border);
}
.destination-pill__icon img { width: 100%; height: 100%; object-fit: cover; }
.destination-pill__label { display: block; font-size: 0.8rem; font-weight: 600; }

/* ==========================================================================
   6. RECENT BLOG GRID (Home + Index)
   ========================================================================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  padding: 2.5rem 0;
}
@media (max-width: 980px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

.post-card { display: flex; flex-direction: column; min-width: 0; }
.post-card__thumb {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 2;
  margin-bottom: 0.85rem;
  background: var(--color-bg-alt);
}
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.category-pill {
  display: inline-block;
  background: rgba(46, 49, 146, 0.1);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 0.6rem;
  width: fit-content;
}

.post-card__title {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
.post-card__title a { color: var(--color-text); }
.post-card__title a:hover { color: var(--color-primary); text-decoration: none; }

.post-card__meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 10px;
  margin-bottom: 0.5rem;
}
.post-card__excerpt { font-size: 0.92rem; color: var(--color-text-muted); margin: 0; }

.pagination { display: flex; justify-content: center; gap: 8px; padding: 1.5rem 0 3rem; }
.pagination a, .pagination span {
  padding: 0.5em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ==========================================================================
   7. SINGLE POST LAYOUT
   ========================================================================== */
.post-header {
  max-width: var(--content-width);
  margin: 2rem auto 0;
  padding: 0 20px;
}
.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.post-header__meta strong { color: var(--color-text); }

.affiliate-disclosure {
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-accent);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding: 0.7em 1em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0 1.5rem;
}

.post-featured-image {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 0 20px;
}
.post-featured-image img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: var(--gap);
  align-items: start;
}
.single-layout > article,
.single-layout > .sidebar { min-width: 0; }
@media (max-width: 960px) {
  .single-layout { grid-template-columns: 1fr; }
}

.entry-content { max-width: var(--content-width); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content blockquote {
  margin: 1.5em 0;
  padding: 0.2em 1.2em;
  border-left: 3px solid var(--color-primary);
  color: var(--color-text-muted);
  font-style: italic;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.entry-content th, .entry-content td { border: 1px solid var(--color-border); padding: 0.6em 0.8em; text-align: left; white-space: nowrap; }
.entry-content th { background: var(--color-bg-alt); }

/* Table of Contents */
.toc-box {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1em 1.3em;
  margin: 1.5rem 0 2rem;
  max-width: var(--content-width);
}
.toc-box__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  cursor: pointer;
}
.toc-box__toggle { background: none; border: none; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.toc-box ol {
  margin: 0.9em 0 0;
  padding-left: 1.2em;
  font-size: 0.92rem;
}
.toc-box li { margin-bottom: 0.45em; }
.toc-box a { color: var(--color-text); font-weight: 600; }
.toc-box a:hover { color: var(--color-primary); }
.toc-box.is-collapsed ol { display: none; }

/* Callout boxes: Pro Tip / Where to Stay / Best Tour / Cost Breakdown */
.callout {
  margin: 1.75em 0;
  padding: 1.1em 1.3em;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  border-left-width: 5px;
  max-width: var(--content-width);
}
.callout__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5em;
}
.callout p:last-child { margin-bottom: 0; }

.callout--tip { background: #eef8ff; border-left-color: var(--color-primary); }
.callout--tip .callout__label { color: var(--color-primary-dark); }

.callout--stay { background: #fff6ec; border-left-color: #e08a2b; }
.callout--stay .callout__label { color: #b06618; }

.callout--tour { background: #f0f9f0; border-left-color: var(--color-success); }
.callout--tour .callout__label { color: #157a3f; }

.callout--cost { background: #fdeeee; border-left-color: var(--color-accent); }
.callout--cost .callout__label { color: var(--color-accent-dark); }

/* Affiliate CTA box */
.affiliate-cta {
  max-width: var(--content-width);
  margin: 2em 0;
  padding: 1.4em;
  background: var(--color-text);
  border-radius: var(--radius);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.affiliate-cta__text h4 { margin: 0 0 0.25em; font-size: 1.05rem; color: #fff; }
.affiliate-cta__text p { margin: 0; font-size: 0.85rem; color: #d9d9d9; }
.affiliate-cta .btn--primary { flex-shrink: 0; }

/* ==========================================================================
   8. SIDEBAR
   ========================================================================== */
.sidebar { position: relative; }
.sidebar__inner { position: sticky; top: calc(var(--header-height) + 20px); display: flex; flex-direction: column; gap: 1.75rem; }

.widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--color-bg);
}

/* Core WordPress widget compatibility — Search, Recent Posts, Categories,
   Archives, Custom HTML, etc. all inherit this so the sidebar looks
   consistent no matter what's dropped in via Appearance > Widgets. */
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { margin-bottom: 0.6em; font-size: 0.88rem; }
.widget li:last-child { margin-bottom: 0; }
.widget li a { color: var(--color-text); font-weight: 600; }
.widget li a:hover { color: var(--color-primary); }
.widget ul ul { margin: 0.5em 0 0 1em; padding-left: 0.75em; border-left: 2px solid var(--color-border); }

.widget .search-form,
.widget .sidebar-search { display: flex; gap: 6px; }
.widget .search-form label { flex: 1; margin: 0; }
.widget .search-field,
.widget input[type="search"],
.widget input[type="text"],
.widget input[type="email"] {
  width: 100%;
  padding: 0.55em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.widget .search-submit,
.widget .sidebar-search button {
  border: none;
  background: var(--color-accent-dark);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0 0.9em;
  cursor: pointer;
  flex-shrink: 0;
}
.widget .search-submit:hover,
.widget .sidebar-search button:hover { background: var(--color-primary); }

/* Recent Posts widget thumbnails, if a plugin adds them, and plain text fallback */
.widget .wp-block-latest-posts__list,
.widget .wp-block-latest-posts { list-style: none; padding: 0; margin: 0; }
.widget select {
  width: 100%;
  padding: 0.5em 0.7em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.widget-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--color-text);
}

/* Latest posts widget */
.latest-post-item { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.latest-post-item:last-child { margin-bottom: 0; }
.latest-post-item__thumb {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-alt);
}
.latest-post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.latest-post-item__title { font-size: 0.88rem; font-weight: 700; line-height: 1.35; margin: 0 0 0.3em; }
.latest-post-item__title a { color: var(--color-text); }
.latest-post-item__date { font-size: 0.75rem; color: var(--color-text-muted); }

/* Ad slot widget: reserve exact space to avoid CLS */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  overflow: hidden;
}
.ad-slot--mrec { width: 300px; height: 250px; max-width: 100%; }
.ad-slot--skyscraper { width: 300px; height: 600px; max-width: 100%; }

/* Sidebar search */
.sidebar-search { display: flex; gap: 6px; }
.sidebar-search input[type="search"] {
  flex: 1;
  padding: 0.55em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.sidebar-search button {
  border: none;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0 0.9em;
  cursor: pointer;
}

/* Affiliate banner widget */
.affiliate-banner img { border-radius: var(--radius-sm); }
.affiliate-banner__caption { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.5em; }

/* Trending posts widget */
.trending-post-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.trending-post-item:last-child { margin-bottom: 0; }
.trending-post-item__rank {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--color-border);
  flex-shrink: 0;
  width: 1.4em;
}
.trending-post-item__title { font-size: 0.88rem; font-weight: 700; line-height: 1.35; }
.trending-post-item__title a { color: var(--color-text); }

/* ==========================================================================
   9. COMMENTS
   ========================================================================== */
.comments-area { max-width: var(--content-width); margin: 3rem 0 0; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-body { border-bottom: 1px solid var(--color-border); padding: 1.25rem 0; }
.comment-author { font-weight: 700; font-size: 0.92rem; }
.comment-metadata { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}
.comment-form p { margin: 0 0 0.9rem; }
.comment-form .comment-form-comment { margin-bottom: 0; }
.comment-form textarea { resize: vertical; min-height: 120px; }
.comment-form .submit {
  display: inline-block;
  padding: 0.65em 1.4em;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  background: var(--color-accent-dark);
  color: #fff;
}
.comment-form .submit:hover { background: var(--color-primary); }
.comment-notes, .logged-in-as { font-size: 0.85rem; color: var(--color-text-muted); }
.comment-reply-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
}
.comment-list .children { list-style: none; margin: 0 0 0 2rem; padding: 0; }
.comment-respond { margin-top: 1.5rem; }
.comments-title { font-size: 1.3rem; margin-bottom: 1.25rem; }

/* ==========================================================================
   9b. ARCHIVE / CATEGORY POST LIST (Version 1.2 Update)
   ========================================================================== */
.archive-description {
  max-width: var(--content-width);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.archive-post-list { max-width: var(--content-width); }

.archive-post-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.archive-post-item:first-child { padding-top: 0; }

.archive-post-item__thumb {
  flex: 0 0 160px;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-alt);
}
.archive-post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.archive-post-item__body { flex: 1; min-width: 0; }

.archive-post-item__title { font-size: 1.15rem; margin: 0.5rem 0 0.4rem; line-height: 1.35; }
.archive-post-item__title a { color: var(--color-text); }
.archive-post-item__title a:hover { color: var(--color-primary); text-decoration: none; }

.archive-post-item__excerpt { font-size: 0.9rem; color: var(--color-text-muted); margin: 0.5rem 0 0; }

@media (max-width: 560px) {
  .archive-post-item { flex-direction: column; }
  .archive-post-item__thumb { flex-basis: auto; width: 100%; }
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer { background: var(--color-dark); color: #ffffff; margin-top: 3rem; }
/* Version 1.1 Update: reduced top padding — the logo used to sit in its
   own full-width row above the grid (with extra padding to match), now
   it's inside Column 1 so that extra top space is no longer needed. */
.site-footer .container { padding: 1.75rem 20px 1.5rem; }

/* Version 1.3 Update: switched from a CSS filter (forcing the logo to a
   flat white silhouette) to a white background chip instead — this keeps
   the logo's actual brand colors (navy + cyan) intact and legible against
   the navy footer, rather than flattening it to solid white. */
.footer-logo-wrapper {
  display: inline-block;
  background-color: #ffffff;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 1rem;
}
.footer-logo-wrapper img,
.footer-logo-wrapper .custom-logo {
  height: 32px;
  width: auto;
  display: block;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-grid > * { min-width: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }
.footer-widget-group { min-width: 0; }
.footer-widget-group .footer-widget + .footer-widget { margin-top: 1.75rem; }

/**
 * Catches ANY heading placed inside a footer widget column — not just
 * ones going through before_title/after_title. If a Heading block is
 * added directly in the block-based Widgets screen (Appearance > Widgets)
 * rather than as a "title" field on a classic widget, WordPress renders it
 * with its own default styling (black text, whatever level was picked —
 * including H1), completely bypassing .footer-widget-title below. This
 * rule normalizes every heading level to match the template regardless of
 * how it was added.
 */
/* Neutralizes the light blog-sidebar .widget styling (white background,
   border, padding) in case WordPress's block-based Widgets screen wraps
   footer content in the same generic "widget" class — without this, any
   widget/block added to a footer column could show an unwanted white box
   instead of sitting flush on the navy background. */
.footer-widget-group .widget {
  background: none;
  border: none;
  padding: 0;
}

/* Version 1.2 Update: added .widget-title explicitly (in case a non-footer
   widget class ever ends up here) and reduced font-size from 0.9rem to
   0.78rem so titles sit more proportionally above their widget content. */
.footer-widget-group h1,
.footer-widget-group h2,
.footer-widget-group h3,
.footer-widget-group h4,
.footer-widget-group h5,
.footer-widget-group h6,
.footer-widget-group .widget-title {
  color: #ffffff !important;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.4;
  margin: 0 0 0.85rem;
}

/* Same reasoning for body text/links from a raw Paragraph or other block
   dropped directly into a footer column. */
.footer-widget-group p,
.footer-widget-group span,
.footer-widget-group li { color: #ffffff; }
.footer-widget-group a { color: #ffffff !important; }
.footer-widget-group a:hover { text-decoration: underline; }

.footer-widget-title { color: #ffffff; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 0.85rem; }
.footer-widget, .footer-widget p { color: #ffffff; }
.footer-widget ul { list-style: none; padding: 0; margin: 0; }
.footer-widget li { margin-bottom: 0.55em; }
.footer-widget a { color: #ffffff; font-size: 0.88rem; }
.footer-widget a:hover { color: #ffffff; text-decoration: underline; }

/* Default WordPress widgets (Categories, Archives, Recent Posts, etc.) dropped
   into a footer widget area, so they inherit the same look instead of showing
   unstyled browser defaults or nested-list indentation that looks broken on a
   dark background. */
.footer-widget select {
  width: 100%;
  max-width: 100%;
  padding: 0.5em 0.7em;
  background: #26295f;
  border: 1px solid #ffffff;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.85rem;
}
.footer-widget ul ul,
.footer-widget ul.children {
  margin: 0.5em 0 0.5em 1em;
  padding-left: 0.75em;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}
.footer-widget label { color: #ffffff; font-size: 0.85rem; display: block; margin-bottom: 0.4em; }

.newsletter-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.5rem; }
.newsletter-form input[type="email"] { min-width: 0; }
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.6em 0.8em;
  border: 1px solid #ffffff;
  border-radius: var(--radius-sm);
  background: #26295f;
  color: #ffffff;
  font-size: 0.88rem;
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.7); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #ffffff;
}
.footer-bottom a { color: #ffffff; }
.footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   11. UTILITIES
   ========================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ==========================================================================
   CHANGELOG
   Version number above (Version: X.Y.Z) is what WordPress shows natively
   in Appearance > Themes and Theme Details — use it as the reference point
   when requesting updates ("on v1.1.0, I need...") so changes are easy to
   track. Newest entry on top.
   ========================================================================== */
/*
1.3.0
- Added a dedicated, smaller .page-title size (clamp 1.8rem-2.2rem / 28px-
  35px) for standard pages (About, Contact, etc.), separate from post
  titles which keep the larger --fs-h1 scale. A short one-word title like
  "About" looked disproportionately large at the post-title size.
- page.php now calls the default get_sidebar() instead of get_sidebar('main'):
  it was pointed at a separate, empty "Main Sidebar" widget area rather
  than the "Blog Post Sidebar" already used (and likely already populated)
  on single.php — that mismatch is what made the sidebar look "completely
  missing" on pages specifically.
- Footer logo: reverted from a CSS filter (flat white silhouette) back to
  a white background chip (.footer-logo-wrapper), restoring the logo's
  actual navy/cyan brand colors instead of flattening it to solid white.

1.2.0
- H1 titles were clamping up to 2.75rem (44px) on desktop, above spec.
  Tightened to clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem) — 28px mobile floor
  up to a hard 40px desktop ceiling, with tuned line-height/margin.
- Fixed footer logo disappearing entirely on sites that never set a logo
  under Customize > Site Identity: the_custom_logo() had no fallback, so
  Column 1 rendered nothing. Now falls back to the theme's bundled logo
  file, matching header.php's existing fallback behavior.
- Footer widget titles: reduced font-size (0.9rem -> 0.78rem) for better
  proportion, and explicitly added .widget-title to the white-text/heading
  override for extra robustness.
- Added archive.php: category, tag, date, and author archives previously
  had no dedicated template and fell back to index.php's homepage grid
  layout with no sidebar. Now a proper 2-column layout (post list +
  the same "Blog Post Sidebar" used on single.php) renders consistently
  across all archive types.

1.1.0
- Added page.php: standard WordPress Pages (About, Contact, etc.) previously
  had no dedicated template and fell back to index.php's blog-card grid
  layout, forcing full page content into a boxed excerpt-style card. Pages
  now render as clean full-width content with a proper 2-column layout.
- Registered a new "Main Sidebar" (functions.php) and sidebar-main.php,
  separate from the Blog Post Sidebar, for the right-hand column on pages.
- Removed comments_template() from page.php as well as single.php — no
  comment form or list anywhere on the site.
- Footer logo moved from a separate full-width row into Column 1 itself
  (using the_custom_logo(), no background chip), so Column 1 now aligns
  evenly with Columns 2-4 instead of starting lower than them.
- Removed the comment section from single posts entirely (template call
  removed) and closed commenting off functionally site-wide (comments_open
  and pings_open filtered to false), not just hidden from view.
- Fixed footer spacing: reduced excess vertical gap between the logo and
  the start of the widget columns (container top padding 3rem -> 1.75rem,
  logo margin-bottom 1.5rem -> 1rem).
- Footer widget headings (any level, including raw Heading blocks added
  directly in the block-based Widgets screen) now always render white,
  matching the template, instead of falling back to default black styling.
- Neutralized the light-sidebar .widget background/border style from
  leaking into footer widget columns.

1.0.0
- Initial theme build: homepage, single post template with sticky TOC and
  callout boxes, monetization sidebar, footer, security hardening, and
  brand color system.
*/
