/* ==========================================================================
   Blog index — editorial card grid + sticky sidebar
   Layout modelled on the golf-lounge / UK Name Change blog, recoloured to the
   Custom Coded Websites cyan-on-dark theme.
   ========================================================================== */

:root {
    --blog-accent: #00ffff;
    --blog-accent-soft: #7dffff;
    --blog-card: rgba(15, 20, 28, 0.72);
    --blog-line: rgba(255, 255, 255, 0.09);
    --blog-line-strong: rgba(0, 255, 255, 0.35);
    --blog-text: #eef4f5;
    --blog-muted: rgba(233, 240, 242, 0.58);
    --blog-radius-lg: 16px;
    --blog-radius-md: 12px;
    --blog-radius-sm: 9px;
    --blog-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-section { padding: 0 0 88px; background: #05080b; }

/* The blog JS injects an animated particle/orb background; the editorial layout
   is intentionally clean, so keep it hidden. */
.blog-animated-background { display: none !important; }

/* ==========================================================================
   Hero — dark band with a soft cyan wash + frosted search
   ========================================================================== */
.blog-hero {
    position: relative;
    padding: 150px 0 68px;
    text-align: center;
    overflow: hidden;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* Homepage-hero particle background */
.blog-hero #particles-js { position: absolute; inset: 0; z-index: 0; }
.blog-hero__inner { position: relative; z-index: 2; max-width: 680px; }
.blog-hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    color: #ffffff;
    font-size: clamp(2.5rem, 5.5vw, 3.7rem);
    line-height: 1.03;
    letter-spacing: -0.015em;
    margin: 0 0 16px;
}
.blog-hero__sub {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.16rem;
    line-height: 1.6;
    max-width: 44ch;
    margin: 0 auto 34px;
}

/* Search field — frosted, lifted, cyan focus ring */
.blog-search {
    display: flex; align-items: center; gap: 2px;
    max-width: 500px; margin: 0 auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 7px 8px 7px 6px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s var(--blog-ease), background 0.2s var(--blog-ease), box-shadow 0.2s var(--blog-ease);
}
.blog-search:focus-within {
    border-color: var(--blog-line-strong);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.14), 0 14px 34px rgba(0, 0, 0, 0.38);
}
.blog-search__icon {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; border-radius: 12px;
    background: transparent; color: var(--blog-accent);
}
.blog-search__icon svg { width: 21px; height: 21px; }
.blog-search__input {
    flex: 1; min-width: 0;
    background: transparent; border: 0; outline: none;
    color: #ffffff; font-family: var(--font-sans); font-size: 1.02rem; font-weight: 500;
    padding: 12px 8px 12px 2px;
}
.blog-search__input::placeholder { color: rgba(255, 255, 255, 0.5); font-weight: 400; }
.blog-search__input::-webkit-search-decoration,
.blog-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.blog-search-clear {
    flex: none; width: 34px; height: 34px; margin-right: 4px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; cursor: pointer;
    background: transparent; color: rgba(255, 255, 255, 0.55);
    opacity: 0; visibility: hidden; transition: all 0.2s var(--blog-ease);
}
.blog-search-clear svg { width: 16px; height: 16px; }
.blog-search-clear.active { opacity: 1; visibility: visible; }
.blog-search-clear:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }

/* ==========================================================================
   Two-column shell: stories on the left, sticky sidebar on the right.
   ========================================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
    padding-top: 60px;
}
@media (max-width: 980px) { .blog-grid { grid-template-columns: 1fr; gap: 32px; } }
/* min-width:0 lets the grid tracks shrink below their content's intrinsic
   width — without it a long word in a title/excerpt blows the grid past the
   container and stretches the whole page. */
.blog-main { min-width: 0; }

.blog-header-row {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.blog-header-row h2 {
    margin: 0; color: #ffffff; font-family: var(--font-display);
    font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em;
}
.blog-count { color: var(--blog-muted); font-size: 0.85rem; }

/* ---- Card grid ---------------------------------------------------------- */
.blog-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 620px) { .blog-cards { grid-template-columns: 1fr; } }

.blog-card {
    position: relative;
    display: flex; flex-direction: column;
    min-width: 0;
    background: var(--blog-card); border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius-lg); overflow: hidden;
    backdrop-filter: blur(6px);
    transition: transform 0.3s var(--blog-ease), border-color 0.3s var(--blog-ease), box-shadow 0.3s var(--blog-ease);
}
/* Editorial cyan accent in place of a hero image. */
.blog-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--blog-accent), rgba(0, 255, 255, 0));
    opacity: 0.6; transition: opacity 0.3s var(--blog-ease);
}
.blog-card:hover {
    transform: translateY(-6px);
    border-color: var(--blog-line-strong);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45), 0 0 26px rgba(0, 255, 255, 0.12);
}
.blog-card:hover::before { opacity: 1; }

.blog-card__body {
    padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; flex: 1;
    text-align: center; align-items: center;
}
.blog-card__meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--blog-accent); font-weight: 600;
}
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--blog-muted); }
.blog-card__date { color: var(--blog-muted); letter-spacing: 0.08em; }

.blog-title {
    font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.15; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere; word-break: break-word;
    min-height: calc(1.15em * 2);
}
.blog-title a { color: var(--blog-text); text-decoration: none; transition: color 0.2s var(--blog-ease); }
.blog-title a:hover { color: var(--blog-accent); }
.blog-card:hover .blog-title a { color: var(--blog-accent); }
/* Whole card is clickable: the title link is stretched over the entire card. */
.blog-card .blog-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }

.blog-excerpt {
    color: var(--blog-muted); font-size: 0.92rem; line-height: 1.6; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere; word-break: break-word;
}

/* ---- Sidebar ------------------------------------------------------------ */
.blog-aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 980px) { .blog-aside { position: static; } }

.blog-panel {
    background: var(--blog-card); border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius-lg); padding: 26px;
}
.blog-panel__title {
    font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--blog-accent); font-weight: 600; margin: 0 0 16px;
}

/* Topics — full-width stacked rows (also the .filter-btn-blog hooks) */
.blog-filter-list { display: flex; flex-direction: column; gap: 8px; }
.blog-chip {
    display: block; width: 100%; text-align: left;
    padding: 12px 18px; border-radius: var(--blog-radius-md);
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--blog-line);
    color: var(--blog-muted); font-size: 0.92rem; font-weight: 600; font-family: var(--font-sans);
    cursor: pointer;
    transition: color 0.2s var(--blog-ease), border-color 0.2s var(--blog-ease), background 0.2s var(--blog-ease);
}
.blog-chip:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); }
.blog-chip.active { background: var(--blog-accent); border-color: var(--blog-accent); color: #04262a; font-weight: 700; }

/* Popular — numbered list */
.blog-popular-list { display: flex; flex-direction: column; }
.blog-popular-item {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 0; border-top: 1px solid var(--blog-line); text-decoration: none;
}
.blog-popular-item:first-child { border-top: 0; padding-top: 0; }
.blog-popular-num {
    flex: none; width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 255, 255, 0.12); color: var(--blog-accent);
    font-weight: 700; font-size: 0.8rem; font-family: var(--font-display);
}
.blog-popular-title { font-size: 0.9rem; color: var(--blog-text); line-height: 1.4; font-weight: 500; transition: color 0.2s var(--blog-ease); }
.blog-popular-item:hover .blog-popular-title { color: var(--blog-accent); }

/* CTA panel */
.blog-panel--cta {
    background: linear-gradient(160deg, rgba(0, 255, 255, 0.07), rgba(15, 20, 28, 0.85));
    border-color: rgba(0, 255, 255, 0.22);
}
.blog-panel__text { color: var(--blog-muted); font-size: 0.9rem; line-height: 1.6; margin: 0 0 18px; }
.blog-cta-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px 20px; border-radius: 999px;
    background: linear-gradient(135deg, #00ffff, #00cccc); color: #04262a;
    font-weight: 700; font-size: 0.9rem; text-decoration: none;
    box-shadow: 0 8px 22px -8px rgba(0, 255, 255, 0.6);
    transition: transform 0.25s var(--blog-ease), box-shadow 0.25s var(--blog-ease);
}
.blog-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(0, 255, 255, 0.7); }
.blog-cta-btn--lg { width: auto; padding: 14px 30px; font-size: 1rem; }

/* ---- Pagination --------------------------------------------------------- */
.blog-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 44px; }
.blog-page-ellipsis {
    min-width: 24px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--blog-muted); font-weight: 600; font-size: 0.9rem; user-select: none;
}
.blog-page-btn {
    min-width: 42px; padding: 10px 14px; border-radius: var(--blog-radius-sm);
    border: 1px solid var(--blog-line); background: transparent; color: var(--blog-muted);
    font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.2s var(--blog-ease), border-color 0.2s var(--blog-ease), background 0.2s var(--blog-ease);
}
.blog-page-btn:hover { color: #ffffff; border-color: var(--blog-line-strong); }
.blog-page-btn.is-active { background: var(--blog-accent); border-color: var(--blog-accent); color: #04262a; }
.blog-page-btn.is-disabled { opacity: 0.35; pointer-events: none; }

/* ---- No-results (client-side search) & empty state ---------------------- */
.no-results { display: none; text-align: center; padding: 60px 20px; color: var(--blog-muted); }
.no-results.show { display: block; }
.no-results svg { width: 42px; height: 42px; color: var(--blog-accent); opacity: 0.7; margin-bottom: 14px; }
.no-results h3 { color: #ffffff; font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 6px; }
.no-results p { margin: 0; font-size: 0.95rem; }

.blog-empty { max-width: 640px; margin: 0 auto; text-align: center; padding: 70px 20px 30px; }
.blog-empty__eyebrow {
    display: inline-block; margin-bottom: 14px;
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
    font-weight: 700; color: var(--blog-accent);
}
.blog-empty h2 { color: #ffffff; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 14px; }
.blog-empty p { color: var(--blog-muted); font-size: 1.02rem; line-height: 1.6; margin: 0 auto 28px; max-width: 46ch; }

/* ---- Mobile topics dropdown (hero) — <details>/<summary>, no JS ---------- */
.blog-topics-dd { display: none; }
.blog-topics-dd__btn {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 12px 20px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff; font-weight: 600; font-size: 0.98rem;
    transition: border-color 0.2s var(--blog-ease), background 0.2s var(--blog-ease);
}
.blog-topics-dd__btn::-webkit-details-marker { display: none; }
.blog-topics-dd__btn:hover { border-color: var(--blog-line-strong); background: rgba(255, 255, 255, 0.12); }
.blog-topics-dd__chev { width: 18px; height: 18px; flex: none; transition: transform 0.2s var(--blog-ease); }
.blog-topics-dd[open] .blog-topics-dd__chev { transform: rotate(180deg); }
.blog-topics-dd__menu {
    margin-top: 10px; overflow: hidden; text-align: left;
    background: #0b1016; border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius-md); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.blog-topics-dd__item {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 13px 18px; color: var(--blog-muted); background: transparent;
    font-weight: 600; font-size: 0.95rem; font-family: var(--font-sans);
    border: 0; border-top: 1px solid var(--blog-line);
    transition: color 0.2s var(--blog-ease), background 0.2s var(--blog-ease);
}
.blog-topics-dd__item:first-child { border-top: 0; }
.blog-topics-dd__item:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
.blog-topics-dd__item.active { background: var(--blog-accent); color: #04262a; }

@media (max-width: 980px) {
    .blog-topics-dd { display: block; width: 260px; margin: 18px auto 0; position: relative; }
    .blog-topics-dd__menu { position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 30; margin-top: 0; }
    .blog-panel--topics { display: none; }
}

/* ==========================================================================
   Responsive refinements
   ========================================================================== */
@media (min-width: 981px) and (max-width: 1200px) {
    .blog-grid .blog-cards { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .blog-title { font-size: 1.18rem; -webkit-line-clamp: 3; line-clamp: 3; min-height: calc(1.18em * 3); }
    .blog-filter-list { flex-direction: row; flex-wrap: wrap; }
    .blog-chip { display: inline-block; width: auto; text-align: center; padding: 10px 18px; border-radius: 999px; }
    .blog-panel--cta { text-align: center; }
    .blog-hero { overflow: visible; }
}
@media (max-width: 720px) {
    .blog-hero { padding: 120px 0 52px; overflow: visible; }
    .blog-hero__title { font-size: clamp(2.1rem, 8vw, 2.8rem); }
    .blog-hero__sub { font-size: 1.02rem; margin-bottom: 28px; }
    .blog-search { max-width: 100%; }
    .blog-grid { padding-top: 40px; }
}
@media (max-width: 620px) {
    .blog-header-row { justify-content: center; text-align: center; }
    .blog-count { display: none; }
}

/* Reveal animation used by blog-list.js when filtering/searching */
@keyframes blogCardFadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
