/* ==========================================================================
   THE AMERICAN HOUSE — Magazine redesign layer
   Loads after main.css. Adds the "restrained magazine" expression:
   high-contrast Playfair serif headings over system-sans body, letterspaced
   kickers, chunky cards, orange-as-fill discipline, cream bands.
   ========================================================================== */

/* --- Self-hosted display font (variable, latin subset) --------------------- */
@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/playfair-display-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Global type + link roles -------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.entry-title,
.hero-title,
.mag-section-title,
.mag-card-title,
.mag-lead-title,
.mag-featured-title,
.mag-masthead-title,
.related-posts-title,
.related-post-title {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* Body-size link text must be the darker rust (#C43D00, 4.6:1), never the
   fill orange. main.css sets `a { color: var(--color-primary) }`; override. */
a { color: var(--color-link); }
a:hover { color: var(--color-primary-hover); }

/* Homepage: headline/card/nav links don't underline on hover (magazine feel) */
body.home a:hover { text-decoration: none; }

/* --- Reusable kicker / category label ------------------------------------ */
.mag-kicker,
.mag-card-cat,
.mag-lead-cat,
.mag-featured-cat,
.mag-masthead-kicker,
.mag-breadcrumb {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-rust);
}
.mag-card-cat a,
.mag-lead-cat a,
.mag-featured-cat a { color: var(--color-rust); }
.mag-card-cat a:hover,
.mag-lead-cat a:hover,
.mag-featured-cat a:hover { color: var(--color-primary-hover); }

/* ==========================================================================
   HEADER — bigger logo, bigger nav "buttons"
   ========================================================================== */
.site-logo { height: 58px; }
@media (max-width: 768px) { .site-logo { height: 46px; } }

.main-navigation a {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-ink);
    padding: 0.55rem 0.85rem;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}
.main-navigation a:hover {
    color: var(--color-primary-hover);
    background: var(--color-cream);
    text-decoration: none;
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-cat > a { color: var(--color-rust); }

/* ==========================================================================
   FULL-BLEED WRAPPER
   header.php wraps all main content in a single #page > .site-container.
   On the magazine homepage & archive we need cream bands and the hero to run
   edge-to-edge, so that wrapper goes full-width and the inner .site-container
   divs (inside each section) do the constraining instead.
   ========================================================================== */
body.home #page > .site-container,
body.archive #page > .site-container {
    max-width: none;
    padding: 0;
}

/* ==========================================================================
   HOMEPAGE (front-page.php) — .mag-home
   ========================================================================== */

/* Tight gap to the footer: last section flush, ~12px breathing room. */
body.home .site-main { padding-bottom: 12px; }
.mag-home > .site-container:last-child .mag-section { margin-bottom: 0; }

/* Full-width lead story — image, kicker, then a two-column deck (title left,
   excerpt + date right) so the space beside the headline is filled. */
.mag-lead { margin-bottom: 3rem; }
.mag-lead-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 8;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}
.mag-lead-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-lead-cat { display: inline-block; margin-bottom: 0.9rem; }
.mag-lead-body {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
.mag-lead-title {
    font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin: 0;
}
.mag-lead-title a { color: var(--color-ink); }
.mag-lead-title a:hover { color: var(--color-primary-hover); }
.mag-lead-aside { padding-top: 0.4rem; }
.mag-lead-excerpt {
    font-size: 1.15rem;
    color: var(--color-text-medium);
    margin: 0 0 1rem;
}
.mag-lead-date { font-size: 0.875rem; color: var(--color-text-light); }

/* Section (category row) */
.mag-section { margin-bottom: 3rem; }
.mag-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.85rem;
    margin-bottom: 2rem;
}
.mag-section-title {
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}
.mag-section-title a { color: var(--color-ink); }
.mag-section-title a:hover { color: var(--color-primary-hover); }
.mag-viewall {
    flex: none;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-rust);
    white-space: nowrap;
}
.mag-viewall:hover { color: var(--color-primary-hover); text-decoration: none; }

/* Card grid + card (shared by homepage rows and archive grid) */
.mag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 2rem;
}
.mag-card { display: flex; flex-direction: column; }
.mag-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0.9rem;
    background: var(--color-background-light);
}
.mag-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.mag-card:hover .mag-card-thumb img { transform: scale(1.03); }
.mag-card-cat { display: inline-block; margin-bottom: 0.55rem; }
.mag-card-title {
    font-size: 1.4rem;
    line-height: 1.28;
    font-weight: 700;
    margin: 0 0 0.6rem;
}
.mag-card-title a { color: var(--color-ink); }
.mag-card-title a:hover { color: var(--color-primary-hover); }
.mag-card-date {
    margin-top: auto;
    font-size: 0.82rem;
    color: var(--color-text-light);
}

/* ==========================================================================
   NEWSLETTER BAND (full-bleed cream) — .mag-band
   ========================================================================== */
.mag-band {
    background: var(--color-cream);
    border-top: 1px solid var(--color-rule);
    border-bottom: 1px solid var(--color-rule);
    padding: 3.25rem 0;
    margin: 0 0 3rem;
}
.mag-band .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.mag-band-text { max-width: 34rem; }
.mag-band-title {
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: var(--color-ink);
}
.mag-band-sub { margin: 0; color: var(--color-text-medium); font-size: 0.95rem; }
.mag-band-form { display: flex; gap: 0.5rem; flex: none; }
.mag-band-form input[type="email"] {
    width: 16rem; max-width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid var(--color-rule);
    border-radius: 4px;
    background: #fff;
    font-size: 0.95rem;
}
.mag-band-form input[type="email"]:focus {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    border-color: transparent;
}
.mag-btn,
.mag-band-form button {
    height: 48px;
    padding: 0 1.5rem;
    border: none;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.mag-btn:hover,
.mag-band-form button:hover { background: var(--color-primary-hover); color: #fff; }

/* ==========================================================================
   AD CONTAINERS — white, hairline border, reserved height, labeled
   ========================================================================== */
.mag-ad {
    border: 1px solid var(--color-rule);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    margin: 0 0 3rem;
}
.mag-ad::before {
    content: "Advertisement";
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-light);
}
.mag-ad-leaderboard { min-height: 100px; }
.mag-ad-inline { min-height: 280px; margin: 3rem 0; }

/* ==========================================================================
   ARCHIVE (archive.php) — .mag-archive
   ========================================================================== */
.mag-archive { padding-top: 3rem; }
.mag-masthead { text-align: center; margin-bottom: 2rem; }
.mag-masthead-kicker { display: block; margin-bottom: 1rem; }
.mag-masthead-title {
    font-size: clamp(2.5rem, 1.8rem + 3vw, 3.75rem);
    font-weight: 800;
    line-height: 1.08;
    margin: 0 0 1rem;
    color: var(--color-ink);
}
.mag-masthead-desc {
    max-width: 46rem;
    margin: 0 auto 0.9rem;
    color: var(--color-text-medium);
}
.mag-masthead-count { font-size: 0.85rem; color: var(--color-text-light); }
.mag-rule {
    border: 0;
    border-top: 1px solid var(--color-rule);
    margin: 0 0 3rem;
}

/* Featured lead item (split) */
.mag-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 3rem;
}
.mag-featured-media {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-background-light);
}
.mag-featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-featured-cat { display: inline-block; margin-bottom: 0.9rem; }
.mag-featured-title {
    font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 0.9rem;
}
.mag-featured-title a { color: var(--color-ink); }
.mag-featured-title a:hover { color: var(--color-primary-hover); }
.mag-featured-excerpt { color: var(--color-text-medium); margin: 0 0 0.9rem; }
.mag-featured-date { font-size: 0.85rem; color: var(--color-text-light); }

/* Archive grid uses the shared .mag-grid; give rows vertical breathing room */
.mag-archive .mag-grid { gap: 3rem 2rem; margin-bottom: 3rem; }

/* Pagination — current page as an orange square. Tight end-gap to footer. */
body.archive .site-main { padding-bottom: 0; }
.mag-pagination { margin: 1.5rem 0 1.75rem; }
.mag-pagination .nav-links,
.mag-pagination.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.mag-pagination .page-numbers {
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--color-text-medium);
}
.mag-pagination a.page-numbers:hover { color: var(--color-primary-hover); }
.mag-pagination .page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}
.mag-pagination .page-numbers.next,
.mag-pagination .page-numbers.prev {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-rust);
}

/* ==========================================================================
   SINGLE (single.php) — article header + furniture + sidebar
   ========================================================================== */
.mag-single { padding-top: 2.5rem; }

.mag-article-head { margin-bottom: 1.75rem; }
.mag-breadcrumb {
    display: block;
    margin-bottom: 1.1rem;
    color: var(--color-text-light);
}
.mag-breadcrumb a { color: var(--color-rust); }
.mag-breadcrumb a:hover { color: var(--color-primary-hover); }
.mag-breadcrumb .sep { color: var(--color-text-light); margin: 0 0.4rem; }
.mag-article-cat { display: inline-block; margin-bottom: 0.9rem; }
.mag-single .entry-title {
    font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    margin: 0 0 1rem;
    color: var(--color-ink);
}
.mag-standfirst {
    font-size: 1.2rem;
    color: var(--color-text-medium);
    margin: 0 0 1.4rem;
    max-width: 62ch;
}
.mag-article-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.mag-article-meta .sep { margin: 0 0.5rem; }

/* Article body: enforce the 760 reading measure + serif H2/H3 rhythm */
.mag-single .content-area { max-width: 760px; }
.mag-single .entry-content { font-size: 1.125rem; line-height: 1.75; }
.mag-single .entry-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem);
    margin-top: 3.5rem;
    margin-bottom: 1rem;
}
.mag-single .entry-content h3 {
    font-family: var(--font-display);
    margin-top: 2.25rem;
}

/* Pull-quote — cream panel, orange left rule (blockquote in content) */
.mag-single .entry-content blockquote {
    background: var(--color-cream);
    border-left: 3px solid var(--color-primary);
    padding: 1.5rem 1.75rem;
    margin: 2.5rem 0;
    border-radius: 0 4px 4px 0;
}
.mag-single .entry-content blockquote p {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.4;
    color: var(--color-ink);
}

/* Table of contents box (works with the plugin's #toc / .toc wrappers) */
.mag-single .entry-content .toc,
.mag-single .entry-content #toc,
.mag-single .entry-content .toc-box {
    background: var(--color-cream);
    border: 1px solid var(--color-rule);
    border-radius: 4px;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0 2.5rem;
}

/* Comparison table (wrapped by claudetheme_wrap_tables -> .table-scroll) */
.mag-single .entry-content .table-scroll table th {
    background: var(--color-background-light);
    border-bottom: 2px solid var(--color-rule);
    text-align: left;
}
.mag-single .entry-content .table-scroll table tr:hover { background: var(--color-cream); }

/* Standalone affiliate CTA already styled by main.css (a.affiliate-cta). Keep. */

/* --- SIDEBAR ------------------------------------------------------------- */
.mag-single .sidebar { flex: 0 0 320px; width: 320px; }

/* Section title inside widgets → letterspaced kicker + short orange rule */
.widget-styled-title,
.widget-area .widget-styled-title {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-rust);
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}

/* "Popular / Latest" list → serif headlines, hairline separators */
.widget_recent_entries li {
    border-bottom: 1px solid var(--color-rule);
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}
/* Sidebar thumbnails +25% (60px -> 75px) */
.mag-single .widget li img,
.mag-single .widget-area .widget li img {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
    height: 75px !important;
}
.widget_recent_entries li:last-child { border-bottom: 0; }
.widget_recent_entries li a {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-ink);
}
.widget_recent_entries li a:hover { color: var(--color-primary-hover); }

/* Sidebar ad → white hairline reserved box with label */
.sidebar-ad {
    border: 1px solid var(--color-rule);
    background: #fff;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}
.sidebar-ad:empty::before,
.sidebar-ad::before {
    content: "Advertisement";
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-light);
}
.sidebar-ad > * { position: relative; }

/* Sidebar newsletter widget → cream panel */
.widget-newsletter {
    background: var(--color-cream);
    border: 1px solid var(--color-rule);
    border-radius: 4px;
    padding: 1.5rem;
}
.widget-newsletter .widget-styled-title { border-bottom: 0; padding-bottom: 0; }
.widget-newsletter .newsletter-form input[type="email"] {
    width: 100%;
    height: 44px;
    padding: 0 0.85rem;
    border: 1px solid var(--color-rule);
    border-radius: 4px;
    margin-bottom: 0.6rem;
    background: #fff;
}
.widget-newsletter .newsletter-form button {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.widget-newsletter .newsletter-form button:hover { background: var(--color-primary-hover); }

/* Sidebar scrolls naturally with the page (no sticky). main.css makes the
   last widget (newsletter) sticky inside a full-height .widget-area, which
   overruns the full-width related-posts section below the content/sidebar
   wrap. Override both so the column just flows. */
.widget-area { height: auto; }
@media (min-width: 769px) {
    .widget-area > :last-child { position: static; top: auto; }
}

/* ==========================================================================
   RELATED POSTS (full-width) — align to card language
   ========================================================================== */
.related-posts-title {
    font-family: var(--font-display);
    font-weight: 800;
}
.related-post-title a { color: var(--color-ink); }
.related-post-title a:hover { color: var(--color-primary-hover); }

/* ==========================================================================
   FOOTER — near-black, orange top rule (keep current structure)
   ========================================================================== */
.site-footer { border-top: 3px solid var(--color-footer-border); }
.footer-site-title,
.footer-nav-title { font-family: var(--font-display); }
.footer-logo { max-width: 240px; height: auto; }

/* Category list = plain stacked links, no pill chips */
.footer-category-list { display: block; }
.footer-category-list li { display: block; margin: 0 0 0.6rem; }
.footer-category-list a {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    border-radius: 0;
    font-size: 0.95rem;
    color: var(--color-footer-text);
    opacity: 0.85;
}
.footer-category-list a:hover {
    background: none;
    opacity: 1;
    color: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   CONTACT FORM (inedit-contact plugin) — theme it
   ========================================================================== */
#inedit-contact-form { max-width: 640px; margin: 1.5rem 0 0; }
#inedit-contact-form .inedit-form-group { margin-bottom: 1.1rem; }
#inedit-contact-form label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-medium);
    margin-bottom: 0.4rem;
}
#inedit-contact-form input[type="text"],
#inedit-contact-form input[type="email"],
#inedit-contact-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-rule);
    border-radius: 4px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
}
#inedit-contact-form input:focus,
#inedit-contact-form textarea:focus {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    border-color: transparent;
}
#inedit-contact-form .inedit-contact-submit {
    height: 48px;
    padding: 0 1.75rem;
    border: none;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}
#inedit-contact-form .inedit-contact-submit:hover { background: var(--color-primary-hover); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .mag-grid { grid-template-columns: repeat(2, 1fr); }
    .mag-single .content-sidebar-wrap { flex-direction: column; }
    .mag-single .sidebar { flex: 1 1 auto; width: 100%; }
    .mag-single .content-area { max-width: 100%; }
}

@media (max-width: 680px) {
    .mag-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .mag-featured { grid-template-columns: 1fr; gap: 1.25rem; }
    .mag-section-head { flex-wrap: wrap; }
    .mag-band .site-container { flex-direction: column; align-items: flex-start; }
    .mag-band-form { width: 100%; }
    .mag-band-form input[type="email"] { flex: 1; width: auto; }
    .mag-lead-media { aspect-ratio: 3 / 2; }
}
