/*
Theme Name: Revelry
Theme URI: https://newrevelry.com
Author: Joshua Pebenito
Description: New Revelry — custom editorial WordPress theme
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: revelry
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600&family=DM+Sans:wght@300;400;500&display=swap');

/* ============================================================
   VARIABLES
============================================================ */
:root {
    --bg:           #EDE8DF;
    --bg-raised:    #E5DFD4;
    --text:         #2A2825;
    --text-muted:   #7C766F;
    --accent:       #A0705A;
    --accent-hover: #8A5C48;
    --rule:         #D3CCC0;

    --serif:  'Cormorant Garamond', Georgia, serif;
    --sans:   'DM Sans', system-ui, sans-serif;

    --max:     1200px;
    --prose:   740px;
    --gutter:  clamp(20px, 4vw, 48px);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.75;
}

/* ============================================================
   HEADER
============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}

.site-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text);
    transition: color 0.2s;
}
.site-logo:hover { color: var(--accent); }

.site-nav ul {
    display: flex;
    gap: 32px;
}
.site-nav a {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.2s;
}
.site-nav a:hover,
.site-nav .current-menu-item a { color: var(--accent); }

/* ============================================================
   HOMEPAGE — HERO
============================================================ */
.hero-section {
    border-bottom: 1px solid var(--rule);
    padding: 48px 0;
}

.hero-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

/* Featured post */
.featured-post {}

.featured-image-link {
    display: block;
    overflow: hidden;
    margin-bottom: 24px;
}
.featured-image-link img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.featured-image-link:hover img { transform: scale(1.03); }

.featured-content {}

.featured-label {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.featured-title {
    font-family: var(--serif);
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}
.featured-title a { color: var(--text); transition: color 0.2s; }
.featured-title a:hover { color: var(--accent); }

.featured-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    max-width: 560px;
}

.featured-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* Sidebar */
.hero-sidebar {
    border-left: 1px solid var(--rule);
    padding-left: 40px;
}

.sidebar-heading {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
}

.sidebar-post {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}
.sidebar-post:last-child { border-bottom: none; }

.sidebar-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
    transition: color 0.2s;
}
.sidebar-tag:hover { color: var(--accent-hover); }

.sidebar-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 5px;
}
.sidebar-title a { color: var(--text); transition: color 0.2s; }
.sidebar-title a:hover { color: var(--accent); }

.sidebar-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ============================================================
   HOMEPAGE — POST SECTIONS (Writing, Blog)
============================================================ */
.post-section {
    padding: 48px 0;
    border-bottom: 1px solid var(--rule);
}

.section-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text);
}

.section-title {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-more {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color 0.2s, letter-spacing 0.2s;
}
.section-more:hover {
    color: var(--accent-hover);
    letter-spacing: 0.14em;
}

/* Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.grid-post {}

.grid-image-link {
    display: block;
    overflow: hidden;
    margin-bottom: 12px;
}
.grid-image-link img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.grid-image-link:hover img { transform: scale(1.04); }

.grid-no-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--bg-raised);
    margin-bottom: 12px;
}

.grid-content {}

.grid-title {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}
.grid-title a { color: var(--text); transition: color 0.2s; }
.grid-title a:hover { color: var(--accent); }

.grid-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ============================================================
   HOMEPAGE — PHOTOS CAROUSEL
============================================================ */
.photos-section { border-bottom: 1px solid var(--rule); }

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 4px 0;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-item {
    flex: 0 0 260px;
}

.carousel-image-link {
    display: block;
    position: relative;
    overflow: hidden;
}
.carousel-image-link img {
    width: 260px;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.carousel-image-link:hover img { transform: scale(1.04); }

.carousel-placeholder {
    width: 260px;
    height: 200px;
    background: var(--bg-raised);
}

.carousel-caption {
    padding: 10px 0 0;
}
.carousel-caption h3 {
    font-family: var(--serif);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text);
}
.carousel-caption time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.carousel-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--rule);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
}
.carousel-btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ============================================================
   SINGLE POST
============================================================ */
.post-hero {
    width: 100%;
    max-height: 560px;
    overflow: hidden;
}
.post-hero img {
    width: 100%;
    max-height: 560px;
    object-fit: cover;
}
.post-hero figcaption {
    max-width: var(--prose);
    margin: 8px auto 0;
    padding: 0 var(--gutter);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.post-container {
    max-width: var(--prose);
    margin: 0 auto;
    padding: 52px var(--gutter) 80px;
}

.post-header { margin-bottom: 36px; }

.post-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.post-tag {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color 0.2s;
}
.post-tag:hover { color: var(--accent-hover); }

.post-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.post-excerpt-lede {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
    border-left: 2px solid var(--accent);
    padding-left: 18px;
    margin-top: 18px;
}

/* Post content */
.post-content {
    font-size: 1.025rem;
    line-height: 1.85;
}
.post-content > * + * { margin-top: 1.4em; }
.post-content h2 {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-top: 2.5em;
    margin-bottom: 0.4em;
}
.post-content h3 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 500;
    margin-top: 2em;
    margin-bottom: 0.4em;
}
.post-content p { margin-bottom: 1.4em; }
.post-content a {
    color: var(--accent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    transition: color 0.2s, border-color 0.2s;
}
.post-content a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
}
.post-content blockquote {
    border-left: 2px solid var(--accent);
    padding: 4px 0 4px 24px;
    margin: 2em 0;
    font-family: var(--serif);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.6;
}
.post-content hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 3em auto;
    width: 40%;
}
.post-content img { width: 100%; margin: 2em 0; }
.post-content figcaption {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -1.5em;
    margin-bottom: 2em;
}
.post-content ul,
.post-content ol { padding-left: 1.5em; margin-bottom: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.3em; }

.post-footer {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.post-footer-tag {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 5px 12px;
    transition: background 0.2s, color 0.2s;
}
.post-footer-tag:hover {
    background: var(--accent);
    color: var(--bg);
}
.post-footer-back {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    transition: color 0.2s;
}
.post-footer-back:hover { color: var(--accent); }

/* ============================================================
   ARCHIVE / TAG PAGES
============================================================ */
.archive-header {
    border-bottom: 1px solid var(--rule);
    padding: 52px var(--gutter) 40px;
    max-width: var(--max);
    margin: 0 auto;
}
.archive-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.archive-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 400;
    letter-spacing: -0.02em;
}
.archive-description {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 480px;
}

.archive-feed {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.archive-card {
    display: flex;
    gap: clamp(24px, 3vw, 48px);
    padding: 40px 0;
    border-bottom: 1px solid var(--rule);
    align-items: center;
}
.archive-card:nth-child(even) { flex-direction: row-reverse; }

.archive-card-image {
    flex: 0 0 44%;
    overflow: hidden;
}
.archive-card-image img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.archive-card-image:hover img { transform: scale(1.03); }

.archive-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.archive-card-tag {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color 0.2s;
}
.archive-card-tag:hover { color: var(--accent-hover); }

.archive-card-title {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.archive-card-title a { color: var(--text); transition: color 0.2s; }
.archive-card-title a:hover { color: var(--accent); }

.archive-card-date { font-size: 0.7rem; color: var(--text-muted); }

.archive-card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Pagination */
.pagination {
    max-width: var(--max);
    margin: 0 auto;
    padding: 40px var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.pagination a { color: var(--accent); transition: color 0.2s; }
.pagination a:hover { color: var(--accent-hover); }

/* ============================================================
   STATIC PAGE
============================================================ */
.page-container {
    max-width: var(--prose);
    margin: 0 auto;
    padding: 64px var(--gutter) 80px;
}
.page-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    border-top: 1px solid var(--rule);
    padding: 32px var(--gutter);
    margin-top: 48px;
}
.site-footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-logo {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0.45;
}
.footer-copy {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr 280px;
        gap: 32px;
    }
    .post-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .hero-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--rule);
        padding-top: 32px;
    }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .archive-card,
    .archive-card:nth-child(even) { flex-direction: column; }
    .archive-card-image { flex: 0 0 auto; width: 100%; }
    .site-nav ul { gap: 18px; }
}

@media (max-width: 480px) {
    .post-grid { grid-template-columns: 1fr; }
    .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============================================================
   MULTIPLE CATEGORY TAGS
============================================================ */
.post-header-meta .post-tag + .post-tag::before {
    content: '·';
    margin-right: 10px;
    color: var(--rule);
}

.post-footer {
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================================
   PHOTOS POST — WIDER LAYOUT
============================================================ */
.photos-post .post-container {
    max-width: 70%;
    min-width: min(600px, 100%);
}

.post-hero--wide {
    max-height: none;
}

.post-hero--wide img {
    max-height: none;
    width: 100%;
    height: auto;
    object-fit: unset;
}

.photos-post .post-content img {
    width: 100%;
    margin: 1.5em 0;
}

/* ============================================================
   HEADER TAGLINE
============================================================ */
.site-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-align: center;
    flex: 1;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .site-tagline { display: none; }
}
