/* ===========================================================================
   Between the Vines — editorial wine-writing theme
   =========================================================================== */

:root {
    --paper: #f8f7f6;
    --ink: #1D1E1E;
    --plum: #4E2F4B;
    --muted: #9a938e;
    --line: rgba(29, 30, 30, 0.14);
    --line-soft: rgba(29, 30, 30, 0.10);
    --accent: #C8133E; /* overridden inline from theme settings in default.hbs */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'News Cycle', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* --- containers --------------------------------------------------------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.container-wide { max-width: 1040px; margin: 0 auto; padding: 0 40px; }
.container-prose { max-width: 720px; margin: 0 auto; padding: 0 40px; }

/* --- top utility bar ---------------------------------------------------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 44px; border-bottom: 1px solid var(--line-soft);
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.topbar-social { display: flex; gap: 20px; }
.topbar-social a { text-decoration: none; }
.topbar-social a:hover { color: var(--accent); }
.topbar-meta { color: var(--muted); }

/* --- masthead ----------------------------------------------------------- */
.masthead { text-align: center; padding: 20px 40px 28px; }
.site-title {
    position: relative; z-index: 1;
    display: inline-block; text-decoration: none; color: var(--accent);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600; font-size: 86px; line-height: 0.9; letter-spacing: 0.5px;
    text-transform: lowercase;
    text-shadow: 0 0 16px #f8f7f6, 0 0 28px #f8f7f6, 0 1px 0 #f8f7f6;
}
.site-title--over { margin-top: -150px; }
.site-tagline {
    position: relative; z-index: 1;
    font-family: 'Newsreader', serif; font-style: italic;
    font-size: 18px; color: #7a736f; margin: 16px 0 0;
}
.masthead-vista {
    max-width: 1180px; margin: 0 auto; height: 296px; overflow: hidden;
}
.masthead-vista img {
    display: block; width: 100%; height: 296px;
    object-fit: cover; object-position: center 58%;
    transform: scale(1.32); transform-origin: center 60%;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,0.3) 80%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,0.3) 80%, rgba(0,0,0,0) 100%);
}
@media (max-width: 700px) {
    .masthead-vista { height: 234px; }
    .masthead-vista img { height: 234px; }
    .site-title--over { margin-top: -120px; }
}
@media (max-width: 600px) {
    .site-title { font-size: 54px; }
    .masthead-vista { height: 190px; }
    .masthead-vista img { height: 190px; }
    .site-title--over { margin-top: -96px; }
}

/* --- navigation --------------------------------------------------------- */
.nav-wrap {
    position: sticky; top: 0; z-index: 50; background: var(--paper);
    border-top: 1px solid rgba(29, 30, 30, 0.16);
    border-bottom: 1px solid rgba(29, 30, 30, 0.16);
}
.nav-inner { position: relative; display: flex; align-items: center; justify-content: center; height: 58px; }
.nav { display: flex; gap: 40px; }
.nav .menu-link {
    text-decoration: none; font-size: 14px; font-weight: 700;
    letter-spacing: 1.8px; text-transform: uppercase;
}
.nav .menu-link:hover, .nav .menu-link.is-current { color: var(--accent); }
.nav-search {
    position: absolute; right: 40px; top: 0; height: 58px;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
    color: var(--ink);
}
.nav-search:hover { color: var(--accent); }

/* --- shared bits -------------------------------------------------------- */
.kicker {
    font-size: 12px; font-weight: 700; letter-spacing: 2.5px;
    text-transform: uppercase; color: var(--accent);
}
.kicker a { text-decoration: none; }
.meta { font-size: 12px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); }
.meta-sm { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

.ph { background: repeating-linear-gradient(135deg, #eceae7 0 11px, #f3f1ef 11px 22px); border: 1px solid rgba(29, 30, 30, 0.12); }
.ph-5x6 { aspect-ratio: 5 / 6; width: 100%; }
.ph-4x3 { aspect-ratio: 4 / 3; width: 100%; }

.section-head { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; }
.section-title { margin: 0; font-weight: 700; font-size: 26px; letter-spacing: 0.5px; white-space: nowrap; }
.rule { flex: 1; height: 1px; background: rgba(29, 30, 30, 0.16); }

/* --- featured ----------------------------------------------------------- */
.featured {
    padding: 60px 40px; border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: 1fr 1.05fr; gap: 60px; align-items: center;
}
.featured .kicker { margin-bottom: 18px; }
.featured-title-link { text-decoration: none; }
.featured-title { margin: 0; font-weight: 700; font-size: 54px; line-height: 1.0; letter-spacing: -0.5px; }
.featured-title-link:hover .featured-title { color: var(--accent); }
.featured-excerpt { font-family: 'Newsreader', serif; font-size: 21px; line-height: 1.5; color: #5b5551; margin: 22px 0 0; max-width: 46ch; }
.featured .meta { margin: 26px 0 22px; }
.read-more {
    display: inline-block; text-decoration: none; font-size: 13px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
    border-bottom: 2px solid var(--accent); padding-bottom: 4px;
}
.read-more:hover { color: var(--accent); }
.featured-image { display: block; }
.featured-image img { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border: 1px solid rgba(29, 30, 30, 0.12); }

/* --- latest grid + cards ------------------------------------------------ */
.latest { padding: 56px 40px 20px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 40px; }
.card { display: flex; flex-direction: column; gap: 14px; }
.card-image { display: block; }
.card-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid rgba(29, 30, 30, 0.12); }
.card .kicker { font-size: 11px; letter-spacing: 2px; }
.card-title-link { text-decoration: none; }
.card-title { margin: 0; font-weight: 700; font-size: 23px; line-height: 1.08; }
.card-title-link:hover .card-title { color: var(--accent); }
.card-excerpt { font-family: 'Newsreader', serif; font-size: 16px; line-height: 1.55; color: #5b5551; margin: 2px 0 0; }

/* --- about band (home) -------------------------------------------------- */
.about-band { background: var(--plum); color: #f3eef2; margin-top: 64px; }
.about-inner { padding: 84px 40px; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; align-items: center; }
.about-band .kicker { color: #e7a9bd; margin-bottom: 20px; }
.about-band h2 { margin: 0; font-weight: 700; font-size: 46px; line-height: 1.0; letter-spacing: -0.5px; }
.about-band p { font-family: 'Newsreader', serif; font-size: 20px; line-height: 1.65; color: #e6dde4; margin: 24px 0 0; max-width: 54ch; }
.about-link {
    display: inline-block; text-decoration: none; margin-top: 28px;
    font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: #f3eef2; border-bottom: 2px solid #e7a9bd; padding-bottom: 4px;
}
.about-portrait { aspect-ratio: 4 / 5; width: 100%; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }

/* --- archive / list ----------------------------------------------------- */
.archive { padding: 60px 40px 0; }
.archive .kicker { font-size: 12px; letter-spacing: 2.5px; margin-bottom: 16px; }
.archive-title { margin: 0; font-weight: 700; font-size: 60px; line-height: 0.98; letter-spacing: -0.5px; }
.archive-count { font-family: 'Newsreader', serif; font-style: italic; font-size: 18px; color: #7a736f; margin-top: 12px; max-width: 60ch; }
.post-list { margin-top: 28px; border-top: 1px solid rgba(29, 30, 30, 0.16); }
.row { display: flex; gap: 28px; align-items: flex-start; padding: 28px 0; border-bottom: 1px solid rgba(29, 30, 30, 0.12); }
.row-image { flex: none; width: 172px; }
.row-image img, .row-image .ph { width: 172px; height: 128px; object-fit: cover; display: block; }
.row-body { flex: 1; }
.row .kicker { font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; }
.row-title-link { text-decoration: none; }
.row-title { margin: 0; font-weight: 700; font-size: 28px; line-height: 1.06; }
.row-title-link:hover .row-title { color: var(--accent); }
.row .meta-sm { margin: 10px 0 0; }
.row-excerpt { font-family: 'Newsreader', serif; font-size: 17px; line-height: 1.55; color: #5b5551; margin: 12px 0 0; max-width: 64ch; }

/* --- single (post + page) ----------------------------------------------- */
.single-top { padding-top: 44px; }
.back-link { text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.single-header { text-align: center; padding-top: 34px; }
.single-header .kicker { margin-bottom: 20px; }
.single-header .kicker a { text-decoration: none; }
.single-title { margin: 0; font-weight: 700; font-size: 52px; line-height: 1.02; letter-spacing: -0.5px; }
.single-standfirst { font-family: 'Newsreader', serif; font-style: italic; font-size: 23px; line-height: 1.5; color: #5b5551; margin: 24px auto 0; max-width: 48ch; }
.single-byline {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 14px;
    font-size: 12px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
    color: var(--muted); margin: 28px auto; padding: 16px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.single-byline .dot { color: #cfc9c4; }
.single-hero { margin: 8px auto 0; }
.single-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid rgba(29, 30, 30, 0.12); }
.single-hero figcaption { font-family: 'Newsreader', serif; font-style: italic; font-size: 14px; color: var(--muted); margin-top: 12px; text-align: center; }
.page-single .single-header { padding-top: 60px; }

/* --- post content ------------------------------------------------------- */
.post-content { font-family: 'Newsreader', serif; color: #26211f; font-size: 20px; line-height: 1.78; padding-top: 48px; }
.post-content p { margin: 0 0 26px; }
.post-content h2 { font-family: 'News Cycle', sans-serif; font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -0.3px; margin: 44px 0 18px; color: var(--ink); }
.post-content h3 { font-family: 'News Cycle', sans-serif; font-weight: 700; font-size: 24px; line-height: 1.15; margin: 36px 0 14px; color: var(--ink); }
.post-content a { color: var(--accent); }
.post-content strong { font-weight: 600; }
.post-content blockquote { margin: 40px 0; padding: 0 0 0 28px; border-left: 3px solid var(--accent); }
.post-content blockquote p { font-style: italic; font-size: 28px; line-height: 1.35; color: var(--ink); margin: 0; }
.post-content figure { margin: 32px 0; }
.post-content figcaption { font-size: 14px; font-style: italic; color: var(--muted); text-align: center; margin-top: 10px; }
.post-content img { width: 100%; height: auto; margin: 0 auto; border: 1px solid rgba(29, 30, 30, 0.12); }

.about-cta-row { display: flex; gap: 14px; margin: 28px 0 0; }
.about-cta { display: inline-block; text-decoration: none; padding: 14px 26px; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #f3eef2; }
.about-cta:hover { opacity: 0.85; }
.about-cta-resume { background: #16241f; }
.about-cta-print { background: #3a1f3a; }
.about-cta-digital { background: #6d1220; }

.about-hero { max-width: 1180px; margin: 64px auto 0; padding: 0 40px; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; align-items: start; }
.about-portrait { aspect-ratio: 4/5; width: 100%; background: #eceae7; border: 1px solid rgba(29,30,30,0.12); overflow: hidden; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-name { font-size: 54px; margin: 10px 0 0; }
.about-bio { font-family: 'Newsreader', serif; font-size: 20px; line-height: 1.55; color: #3a3431; margin: 24px 0 0; }
.about-bio p { margin: 0 0 20px; }
.about-socials { display: flex; gap: 18px; margin-top: 28px; font-size: 12px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
.about-socials a { text-decoration: none; color: #1D1E1E; }
.about-socials a:hover { color: var(--accent); }

.portfolio-header { text-align: center; }
.portfolio-kicker { font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.portfolio-resume-content { text-align: center; }

.portfolio-grid-content .kg-gallery-container,
.portfolio-grid-content .kg-gallery-row { gap: 32px; }
.portfolio-grid-content { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; }
.portfolio-grid-content figure.kg-image-card { margin: 0; }
.portfolio-grid-content figure.kg-image-card img { border: 1px solid rgba(29, 30, 30, 0.12); width: 100%; }
.portfolio-grid-content figcaption { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); text-align: left; margin-top: 8px; }
.post-template .post-content > p:first-of-type::first-letter {
    float: left; font-family: 'News Cycle', sans-serif; font-weight: 700;
    font-size: 88px; line-height: 0.66; padding: 8px 14px 0 0; color: var(--accent);
}

/* --- Koenig editor cards (wide / full-bleed images, galleries) ---------- */
.post-content .kg-card { margin: 36px 0; }
.post-content figure { margin: 36px 0; }
.post-content .kg-width-wide {
    position: relative; width: min(1040px, 92vw);
    margin-left: 50%; transform: translateX(-50%);
}
.post-content .kg-width-full {
    position: relative; width: 100vw;
    margin-left: 50%; transform: translateX(-50%);
}
.post-content .kg-width-wide img,
.post-content .kg-width-full img { width: 100%; }
.post-content .kg-image { display: block; margin-left: auto; margin-right: auto; }
.post-content .kg-image-card figcaption,
.post-content .kg-embed-card figcaption { font-family: 'Newsreader', serif; font-style: italic; font-size: 14px; color: var(--muted); text-align: center; margin-top: 10px; }

/* --- author mini -------------------------------------------------------- */
.author-mini { display: flex; gap: 20px; align-items: center; margin: 56px auto 0; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author-avatar { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; }
.author-name { font-family: 'News Cycle', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
.author-bio { font-family: 'Newsreader', serif; font-size: 16px; line-height: 1.55; color: #5b5551; margin: 6px 0 0; }

.related { padding: 64px 40px 0; }

/* --- Instagram strip (Behold widget) ------------------------------------ */
.instagram-strip { padding: 56px 40px 8px; }
.instagram-strip .behold-feed { display: block; margin-top: 8px; min-height: 120px; }

/* --- footer ------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #f3f1ef; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding: 64px 40px 36px; }
.footer-title { font-weight: 700; font-size: 30px; letter-spacing: 0.5px; }
.footer-tag { font-family: 'Newsreader', serif; font-style: italic; font-size: 17px; color: #a9a29d; margin: 12px 0 0; max-width: 34ch; }
.footer-head { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #8a837e; margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { padding: 20px 40px 48px; border-top: 1px solid rgba(243, 241, 239, 0.12); font-size: 12px; letter-spacing: 1px; color: #8a837e; }

/* --- pagination --------------------------------------------------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 56px 0; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.pagination a { text-decoration: none; color: var(--accent); }
.pagination .page-number { color: var(--muted); }
.nav-previous, .nav-next { display: inline-block; }

/* --- responsive --------------------------------------------------------- */
@media (max-width: 900px) {
    .container, .container-wide, .latest, .archive, .related { padding-left: 24px; padding-right: 24px; }
    .site-title { font-size: 46px; }
    .featured { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px; }
    .featured-title { font-size: 40px; }
    .featured-image { order: -1; }
    .post-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
    .about-inner { grid-template-columns: 1fr; gap: 32px; padding: 56px 24px; }
    .about-portrait { max-width: 320px; }
    .footer-grid { grid-template-columns: 1fr 1fr; padding: 56px 24px 36px; }
    .footer-bottom { padding-left: 24px; padding-right: 24px; }
    .single-title, .archive-title { font-size: 40px; }
    .nav-search { right: 24px; }
}

@media (max-width: 600px) {
    .topbar-meta { display: none; }
    .masthead { padding: 26px 24px 20px; }
    .site-title { font-size: 36px; }
    .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .nav { gap: 20px; flex-wrap: wrap; justify-content: center; }
    .nav-link { font-size: 12px; letter-spacing: 1px; }
    .nav-search { display: none; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .row { flex-direction: column; gap: 14px; }
    .row-image, .row-image img, .row-image .ph { width: 100%; height: auto; }
    .row-image img, .row-image .ph { aspect-ratio: 4 / 3; }
    .single-title { font-size: 34px; }
    .single-standfirst { font-size: 19px; }
    .post-content { font-size: 18px; line-height: 1.72; }
    .post-content blockquote p { font-size: 22px; }
    .post-template .post-content > p:first-of-type::first-letter { font-size: 68px; }
}
