/* ==================================================================
   PAGES v2 — archive (category/tag/author), search, contact, page (legal)
   ================================================================== */

/* Cancel the 128px top/bottom body padding that style.css applies to
   body.page-template / .archive / .search-results / .error-404 / .contact-page
   — our hero sections supply their own spacing. */
body.page-template,
body.archive,
body.archive-category,
body.archive-tag,
body.archive-author,
body.search-results,
body.contact-page,
body.error-404,
body.single-post { padding: 0 !important; }

/* ----- Shared archive hero (category, tag, page, search) ----- */
.h-archive-hero,
.h-search-hero,
.h-page-hero {
    padding: 64px 0 48px;
    background: linear-gradient(180deg, var(--h-bg-alt) 0%, var(--h-bg) 100%);
    border-bottom: 1px solid var(--h-border);
}
.h-archive-hero__label,
.h-search-hero__label,
.h-page-hero__label {
    display: inline-block;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--h-primary);
    padding: 6px 12px;
    border: 1px solid var(--h-primary);
    border-radius: 9999px;
    margin-bottom: 18px;
}
.h-archive-hero__title,
.h-search-hero__title,
.h-page-hero__title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: var(--h-text);
    margin: 0 0 16px;
}
.h-archive-hero__desc,
.h-page-hero__meta {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--h-muted);
    max-width: 60ch;
    margin: 0 0 18px;
}
.h-archive-hero__count {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    color: var(--h-muted);
    margin: 0;
}
.h-archive-hero__count strong { color: var(--h-text); }

/* ----- Author archive hero (special layout) ----- */
.h-archive-hero--author { padding: 72px 0 56px; }
.h-archive-hero__author {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    align-items: center;
}
@media (max-width: 720px) {
    .h-archive-hero__author { grid-template-columns: 1fr; text-align: center; }
}
.h-archive-hero__avatar {
    width: 180px; height: 180px;
    border-radius: 9999px;
    object-fit: cover;
    border: 4px solid var(--h-bg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.h-archive-hero__info { min-width: 0; }
.h-archive-hero__stats {
    display: flex;
    gap: 16px;
    margin: 14px 0 16px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    color: var(--h-muted);
}
.h-archive-hero__stats strong { color: var(--h-text); font-weight: 700; }
.h-archive-hero__socials { display: flex; gap: 8px; flex-wrap: wrap; }
.h-archive-hero__socials a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--h-border);
    border-radius: 8px;
    color: var(--h-text);
    background: var(--h-bg);
    transition: all 0.2s;
}
.h-archive-hero__socials a:hover { background: var(--h-primary); color: #fff; border-color: var(--h-primary); }
.h-archive-hero__socials svg { width: 16px; height: 16px; }

/* ----- Archive body (shared by archive, search) ----- */
.h-archive-body { padding: 56px 0 80px; background: var(--h-bg); }
.h-archive-empty {
    text-align: center;
    color: var(--h-muted);
    padding: 80px 0;
    font-size: 17px;
}
.h-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}
@media (max-width: 900px)  { .h-archive-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
@media (max-width: 560px)  { .h-archive-grid { grid-template-columns: 1fr; } }

.h-archive-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--h-bg);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s;
}
.h-archive-card:hover { transform: translateY(-4px); }
.h-archive-card__img {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 14px;
    background: var(--h-border);
    position: relative;
}
.h-archive-card__img picture, .h-archive-card__img img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s;
}
.h-archive-card:hover .h-archive-card__img img { transform: scale(1.05); }

.h-archive-card__body { padding: 0 4px 8px; }
.h-archive-card__cat {
    display: inline-block;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--h-primary);
    text-decoration: none;
    margin-bottom: 10px;
}
.h-archive-card__title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 12px;
}
.h-archive-card__title a { color: var(--h-text); text-decoration: none; }
.h-archive-card__title a:hover { color: var(--h-primary); }
.h-archive-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--h-muted);
}
.h-archive-card__meta img {
    border-radius: 9999px;
    object-fit: cover;
}
.h-archive-card__dot { opacity: 0.4; }

/* ----- Search hero form ----- */
.h-search-hero__title span {
    color: var(--h-primary);
    font-style: italic;
}
.h-search-hero__form {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 640px;
    margin-top: 32px;
    padding: 6px 6px 6px 18px;
    background: var(--h-bg);
    border: 2px solid var(--h-border);
    border-radius: 12px;
    transition: border-color 0.2s;
}
.h-search-hero__form:focus-within { border-color: var(--h-primary); }
.h-search-hero__form svg {
    width: 20px; height: 20px;
    color: var(--h-muted);
    flex-shrink: 0;
}
.h-search-hero__form input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    color: var(--h-text);
}
.h-search-hero__form input::placeholder { color: var(--h-muted); }
.h-search-hero__form button {
    padding: 12px 24px;
    background: var(--h-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.h-search-hero__form button:hover { background: var(--h-accent); }

/* ==================================================================
   Contact v2
   ================================================================== */
.h-contact {
    padding: 72px 0 96px;
    background: var(--h-bg);
}
.h-contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 64px;
    align-items: start;
}
@media (max-width: 900px) { .h-contact__grid { grid-template-columns: 1fr; gap: 40px; } }

.h-contact__label {
    display: inline-block;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--h-primary);
    padding: 6px 12px;
    border: 1px solid var(--h-primary);
    border-radius: 9999px;
    margin-bottom: 20px;
}
.h-contact__title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--h-text);
    margin: 0 0 18px;
}
.h-contact__intro {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--h-muted);
    margin: 0 0 32px;
}

.h-contact__channels {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}
.h-contact__channels li {
    padding: 16px 0;
    border-top: 1px solid var(--h-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.h-contact__channels li:last-child { border-bottom: 1px solid var(--h-border); }
.h-contact__channel-label {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--h-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.h-contact__channels a {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 16px;
    color: var(--h-text);
    text-decoration: none;
    font-weight: 500;
}
.h-contact__channels a:hover { color: var(--h-primary); }

.h-contact__socials {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    color: var(--h-muted);
    flex-wrap: wrap;
}
.h-contact__socials a {
    color: var(--h-text);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--h-border);
    border-radius: 9999px;
    font-size: 13px;
    transition: all 0.2s;
}
.h-contact__socials a:hover { background: var(--h-primary); color: #fff; border-color: var(--h-primary); }

.h-contact__form {
    background: var(--h-bg-alt);
    border-radius: 16px;
    padding: 32px;
}
.h-contact__form-fallback { color: var(--h-accent); text-align: center; margin: 0; }

/* Style the contact-form plugin output inside .h-contact__form */
.h-contact__form .cf-form input,
.h-contact__form .cf-form textarea,
.h-contact__form .cf-form select {
    width: 100%;
    padding: 14px 16px;
    background: var(--h-bg);
    border: 1px solid var(--h-border);
    border-radius: 10px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    color: var(--h-text);
    margin-bottom: 14px;
    transition: border-color 0.2s;
}
.h-contact__form .cf-form input:focus,
.h-contact__form .cf-form textarea:focus,
.h-contact__form .cf-form select:focus {
    outline: none;
    border-color: var(--h-primary);
}
.h-contact__form .cf-form label {
    display: block;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--h-text);
    margin-bottom: 6px;
}
.h-contact__form .cf-form button,
.h-contact__form .cf-form input[type="submit"] {
    width: auto;
    display: inline-block;
    padding: 14px 32px;
    background: var(--h-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
.h-contact__form .cf-form button:hover,
.h-contact__form .cf-form input[type="submit"]:hover {
    background: var(--h-accent);
}

/* ==================================================================
   Static page (legal) prose
   ================================================================== */
.h-page-body {
    padding: 56px 0 96px;
    background: var(--h-bg);
}
.h-page-prose {
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--h-text);
}
.h-page-prose > * + * { margin-top: 1.2em; }
.h-page-prose h2 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 40px 0 14px;
    color: var(--h-text);
}
.h-page-prose h3 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--h-text);
}
.h-page-prose p { margin: 0; }
.h-page-prose p + p { margin-top: 1em; }
.h-page-prose a { color: var(--h-primary); text-decoration: underline; text-underline-offset: 3px; }
.h-page-prose ul, .h-page-prose ol { padding-left: 22px; margin: 0; }
.h-page-prose ul li, .h-page-prose ol li { margin: 6px 0; }
.h-page-prose blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--h-primary);
    background: var(--h-bg-alt);
    border-radius: 0 10px 10px 0;
    font-style: italic;
}
.h-page-prose blockquote p { margin: 0; }
.h-page-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}
.h-page-prose th, .h-page-prose td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--h-border);
    text-align: left;
}
.h-page-prose th { font-weight: 700; background: var(--h-bg-alt); }

/* ==================================================================
   404 page
   ================================================================== */
.h-404 {
    padding: 80px 0 120px;
    background: linear-gradient(180deg, var(--h-bg-alt) 0%, var(--h-bg) 60%);
    min-height: 60vh;
}
.h-404__inner {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}
.h-404__visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--h-primary);
}
.h-404__digit {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(88px, 14vw, 148px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--h-text);
}
.h-404__orb {
    display: inline-flex;
    width: clamp(96px, 14vw, 148px);
    height: clamp(96px, 14vw, 148px);
    align-items: center;
    justify-content: center;
    color: var(--h-primary);
}
.h-404__orb svg { width: 100%; height: 100%; transform: rotate(180deg); }
.h-404__title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--h-text);
    margin: 0 0 14px;
}
.h-404__desc {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--h-muted);
    margin: 0 0 28px;
}
.h-404__actions {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 48px;
}
.h-404__btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    border: 1px solid var(--h-border);
    border-radius: 10px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--h-text);
    background: var(--h-bg);
    text-decoration: none;
    transition: all 0.2s;
}
.h-404__btn:hover { border-color: var(--h-primary); color: var(--h-primary); }
.h-404__btn--primary {
    background: var(--h-primary);
    color: #fff;
    border-color: var(--h-primary);
}
.h-404__btn--primary:hover { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }

.h-404__suggest {
    text-align: left;
    background: var(--h-bg);
    border: 1px solid var(--h-border);
    border-radius: 14px;
    padding: 24px;
    margin-top: 20px;
}
.h-404__suggest h2 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--h-muted);
    margin: 0 0 16px;
}
.h-404__suggest ul { list-style: none; margin: 0; padding: 0; }
.h-404__suggest li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--h-border); }
.h-404__suggest a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--h-text);
}
.h-404__suggest img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.h-404__suggest span {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
}
.h-404__suggest a:hover span { color: var(--h-primary); }

/* ==================================================================
   Dark mode
   ================================================================== */
html[data-theme="dark"] .h-archive-hero,
html[data-theme="dark"] .h-search-hero,
html[data-theme="dark"] .h-page-hero {
    background: linear-gradient(180deg, var(--h-bg-alt) 0%, var(--h-bg) 100%) !important;
    border-color: var(--h-border) !important;
}
html[data-theme="dark"] .h-archive-hero__title,
html[data-theme="dark"] .h-search-hero__title,
html[data-theme="dark"] .h-page-hero__title,
html[data-theme="dark"] .h-archive-hero__stats strong,
html[data-theme="dark"] .h-archive-card__title a,
html[data-theme="dark"] .h-contact__title,
html[data-theme="dark"] .h-contact__channels a,
html[data-theme="dark"] .h-page-prose,
html[data-theme="dark"] .h-page-prose h2,
html[data-theme="dark"] .h-page-prose h3,
html[data-theme="dark"] .h-archive-empty,
html[data-theme="dark"] .h-archive-hero__socials a,
html[data-theme="dark"] .h-contact__socials a { color: var(--h-text) !important; }

html[data-theme="dark"] .h-archive-body,
html[data-theme="dark"] .h-contact,
html[data-theme="dark"] .h-page-body { background: var(--h-bg) !important; }

html[data-theme="dark"] .h-archive-card,
html[data-theme="dark"] .h-contact__form,
html[data-theme="dark"] .h-page-prose blockquote { background: var(--h-bg-alt) !important; }

html[data-theme="dark"] .h-archive-hero__socials a,
html[data-theme="dark"] .h-contact__socials a { background: var(--h-bg) !important; border-color: var(--h-border) !important; }

html[data-theme="dark"] .h-search-hero__form,
html[data-theme="dark"] .h-contact__form .cf-form input,
html[data-theme="dark"] .h-contact__form .cf-form textarea,
html[data-theme="dark"] .h-contact__form .cf-form select { background: var(--h-bg) !important; border-color: var(--h-border) !important; color: var(--h-text) !important; }

html[data-theme="dark"] .h-404 { background: linear-gradient(180deg, var(--h-bg-alt) 0%, var(--h-bg) 60%) !important; }
html[data-theme="dark"] .h-404__digit,
html[data-theme="dark"] .h-404__title,
html[data-theme="dark"] .h-404__btn,
html[data-theme="dark"] .h-404__suggest a { color: var(--h-text) !important; }
html[data-theme="dark"] .h-404__btn { background: var(--h-bg) !important; border-color: var(--h-border) !important; }
html[data-theme="dark"] .h-404__suggest { background: var(--h-bg-alt) !important; border-color: var(--h-border) !important; }
