/*
Theme Name: Hemingway Modern
Theme URI: https://smemorial.ca
Author: Star Heir
Author URI: https://smemorial.ca
Description: A modern, standalone refresh of the classic Hemingway theme — clean editorial design, responsive, and block-editor ready.
Version: 3.1.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hemingway-modern
Tags: blog, editorial, modern, responsive, two-columns, custom-header
*/

:root {
    --bg: #faf8f5;
    --surface: #ffffff;
    --text: #2b2b2b;
    --text-muted: #5a544e;
    --text-dim: #8a847c;
    --accent: #3a4a5c;
    --accent-dark: #2c3a4a;
    --accent-soft: #eef1f4;
    --line: #e0dbd3;
    --line-soft: #ece7df;
    --shadow: 0 1px 8px rgba(43,43,43,0.05);
    --shadow-hover: 0 4px 20px rgba(43,43,43,0.08);
    --radius: 8px;
    --radius-sm: 6px;
    --container: 1100px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(ellipse at top, rgba(44,95,93,0.04) 0%, transparent 60%);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-dark); }
p { margin: 0 0 18px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }

/* Custom header banner */
.custom-header-banner { width: 100%; max-height: 416px; overflow: hidden; }
.custom-header-banner img { width: 100%; height: auto; display: block; object-fit: cover; }

/* Hero header (with header image) */
.header-hero {
    position: relative; min-height: 240px;
    background-size: cover; background-repeat: no-repeat; background-position: center center;
    background-color: #2c3a4a;
    display: flex; align-items: flex-end;
    overflow: hidden;
}
.header-hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.75) 100%);
    z-index: 0;
}
.header-hero-overlay { position: relative; z-index: 1; width: 100%; padding: 64px 0 40px; }
.header-hero-inner {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
}
.hero-brand { flex: 1; min-width: 240px; }
.hero-title {
    font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700; color: #fff; margin: 0 0 6px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.hero-tagline { color: rgba(255,255,255,0.85); font-style: italic; margin: 0; text-shadow: 0 1px 8px rgba(0,0,0,0.5); }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.hero-phone {
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
    color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.hero-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff;
    font-size: 1.2rem; transition: background 0.2s;
    backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.2);
}
.hero-search-btn:hover { background: rgba(255,255,255,0.3); }
.hero-nav .nav-list a {
    background: rgba(0,0,0,0.55); color: #fff;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.hero-nav .nav-list a:hover { background: rgba(44,95,93,0.85); border-color: rgba(255,255,255,0.4); }
.search-nav-link { font-size: 1.1rem !important; }

/* Hero search bar */
.hero-search-bar { padding: 20px 0 8px; text-align: center; }
.hero-search-form {
    display: flex; gap: 8px; max-width: 600px; margin: 0 auto;
    justify-content: center;
}
.hero-search-form input[type="search"] {
    flex: 1; padding: 12px 18px;
    border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.15); color: #fff;
    font-family: var(--font-body); font-size: 0.95rem;
    backdrop-filter: blur(6px);
}
.hero-search-form input[type="search"]::placeholder { color: rgba(255,255,255,0.7); }
.hero-search-form input[type="search"]:focus {
    outline: none; border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.25);
}
.hero-search-form button {
    padding: 12px 24px; border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.hero-search-form button:hover { background: var(--accent-dark); }

/* Header bar (no image) */
.header-bar { background: #fff; box-shadow: 0 1px 0 var(--line); }
.header-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.phone-link { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--accent); }

/* Hide legacy header bar (from stale header.php) */
.site-header .header-top,
.site-header .header-bar { display: none !important; }

/* Header */
.site-header {
    background: #fff;
    box-shadow: 0 1px 0 var(--line);
    position: sticky; top: 0; z-index: 100;
}
.header-top { background: #fff; }
.header-top-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 18px 0; flex-wrap: wrap;
}
.site-branding { flex: 1; min-width: 200px; }
.site-title {
    font-family: var(--font-display);
    font-size: 1.7rem; font-weight: 700;
    color: var(--text); letter-spacing: 0.02em;
}
.site-title a { color: inherit; }
.header-phone .phone-link {
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 700;
    color: var(--accent);
    display: inline-flex; align-items: center; gap: 8px;
}
.header-phone .phone-link::before { content: '📞'; font-size: 1.2rem; }
.header-nav {
    background: var(--accent);
    padding: 0;
}
.header-nav .container { display: flex; align-items: center; }
.nav-list { list-style: none; display: flex; gap: 0; flex-wrap: wrap; }
.nav-list a {
    color: #fff; font-weight: 500; font-size: 0.95rem;
    padding: 14px 22px; display: inline-block;
    transition: background 0.2s;
    border-bottom: 3px solid transparent;
}
.nav-list a:hover { background: rgba(255,255,255,0.1); border-bottom-color: rgba(255,255,255,0.5); }
.nav-toggle { display: none; }

/* Main */
.site-main { padding: 48px 0 64px; }

/* Layout */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* Obituaries header */
.obituaries-header { margin-bottom: 32px; text-align: center; }
.page-title {
    font-size: 2.4rem; margin: 0 0 8px;
    position: relative; display: inline-block;
}
.page-title::after {
    content: ''; display: block; width: 60px; height: 3px;
    background: var(--accent); margin: 12px auto 0; border-radius: 2px;
}

/* Obituary grid */
.obituary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
}
.obituary-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.4s var(--ease), box-shadow 0.4s, border-color 0.4s;
    display: flex; flex-direction: column;
    position: relative;
}
.obituary-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent), #4a9b98);
    opacity: 0; transition: opacity 0.4s;
    z-index: 2;
}
.obituary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}
.obituary-card:hover::before { opacity: 1; }
.obituary-thumb {
    display: block; aspect-ratio: 3/4; overflow: hidden;
    background: var(--line-soft); position: relative;
}
.obituary-thumb::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
}
.obituary-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.obituary-card:hover .obituary-thumb img { transform: scale(1.06); }
.obituary-thumb-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--line-soft), var(--accent-soft)); }
.obituary-title {
    font-family: var(--font-display); font-size: 1.15rem;
    margin: 16px 18px 6px; line-height: 1.3; font-weight: 600;
}
.obituary-title a { color: var(--text); }
.obituary-title a:hover { color: var(--accent); }
.obituary-dates {
    font-size: 0.85rem; color: var(--text-dim); margin: 0 18px 6px;
    font-style: italic;
}
.obituary-excerpt {
    font-size: 0.88rem; color: var(--text-muted); margin: 0 18px 12px;
    line-height: 1.5;
}
.obituary-card .read-more {
    margin: 0 18px 18px; font-size: 0.85rem;
    color: var(--accent); font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
    transition: gap 0.2s;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.obituary-card .read-more:hover { gap: 8px; }

/* Pagination */
.pagination { margin: 48px 0; text-align: center; }
.pagination .nav-links a, .pagination a {
    display: inline-block; padding: 10px 20px; margin: 0 4px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text-muted); background: var(--surface);
    transition: all 0.2s;
}
.pagination .nav-links a:hover, .pagination a:hover {
    border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}

/* Single obituary */
.single-obituary { max-width: 820px; margin: 0 auto; }
.single-obituary .obituary-photo {
    margin: 0 0 32px; border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
.single-obituary .obituary-photo img { width: 100%; height: auto; display: block; }
.single-obituary .entry-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 12px;
}
.single-obituary .post-meta {
    font-size: 0.9rem; color: var(--text-dim);
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 28px; padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.post-meta-bottom {
    margin-top: 28px; padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--text-dim); font-size: 0.9rem;
}
.post-meta-bottom p { margin: 0 0 6px; }

/* Memorial actions */
.memorial-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.action-btn {
    display: inline-block; padding: 10px 20px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface);
    color: var(--accent); font-weight: 600; font-size: 0.9rem;
    transition: all 0.2s;
}
.action-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Post nav */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; }
.post-nav a {
    display: block; padding: 16px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--surface);
    transition: all 0.2s;
}
.post-nav a:hover { border-color: var(--accent); background: var(--accent-soft); }
.post-nav h5 { font-size: 0.8rem; color: var(--text-dim); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.1em; }
.post-nav-older { text-align: left; }
.post-nav-newer { text-align: right; }

/* Single page */
.single-page { max-width: 820px; margin: 0 auto; }
.single-page .entry-title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 20px; }
.entry-content { font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.entry-content p { margin: 0 0 18px; }
.entry-content h2, .entry-content h3 { margin: 28px 0 12px; }
.entry-content img { border-radius: var(--radius-sm); margin: 20px 0; }
.entry-content a { color: var(--accent); border-bottom: 1px solid rgba(44,95,93,0.3); }
.entry-content a:hover { border-color: var(--accent); }

/* Sidebar */
.sidebar { position: sticky; top: 24px; }
.widget {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 24px;
    margin-bottom: 24px; box-shadow: var(--shadow);
}
.widget-title {
    font-family: var(--font-display); font-size: 1.2rem;
    margin: 0 0 14px; color: var(--text);
    padding-bottom: 10px; border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.widget ul { list-style: none; }
.widget ul li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.widget ul li:last-child { border-bottom: none; }
.widget a { color: var(--text-muted); transition: color 0.2s; }
.widget a:hover { color: var(--accent); }
.search-widget input[type="search"] {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-widget input[type="search"]:focus {
    border-color: var(--accent); outline: none;
    box-shadow: 0 0 0 3px rgba(44,95,93,0.12);
}
.search-widget button, .search-widget input[type="submit"] {
    margin-top: 10px; padding: 12px 18px;
    border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    cursor: pointer; font-weight: 600; width: 100%;
    transition: background 0.2s;
}
.search-widget button:hover, .search-widget input[type="submit"]:hover { background: var(--accent-dark); }
.recent-list { list-style: none; }
.recent-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.recent-list li:last-child { border-bottom: none; }
.recent-list a { color: var(--text-muted); font-size: 0.92rem; }
.recent-list a:hover { color: var(--accent); }

/* Footer */
.site-footer {
    background: #1a2423;
    color: #fff; padding: 48px 0 24px;
    margin-top: 64px;
}
.footer-contact {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 32px; padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-contact h3 {
    color: #fff; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.15em;
    margin: 0 0 12px;
}
.footer-contact p { color: rgba(255,255,255,0.7); margin: 0 0 4px; font-size: 0.95rem; }
.footer-contact a { color: rgba(255,255,255,0.85); transition: color 0.2s; }
.footer-contact a:hover { color: #fff; }
.footer-bottom { padding-top: 20px; text-align: center; }
.footer-bottom p { color: rgba(255,255,255,0.5); font-size: 0.85rem; margin: 0; }

/* AFSRB footer link */
.footer-extra { padding: 24px 0; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-extra .container { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.afsrb-link {
    display: inline-flex; align-items: center; gap: 12px;
    color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 500;
    transition: color 0.2s;
}
.afsrb-link:hover { color: #fff; }
.afsrb-link img { max-width: 120px; height: auto; border-radius: 4px; }
.afsrb-info {
    color: rgba(255,255,255,0.6); font-size: 0.8rem; line-height: 1.6; margin: 0;
    max-width: 600px;
}
.afsrb-info a { color: rgba(255,255,255,0.75); text-decoration: underline; }
.afsrb-info a:hover { color: #fff; }

/* Comments */
.comments-area { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.comments-title { font-size: 1.4rem; margin: 0 0 24px; }
.comment-list { list-style: none; }
.comment-item { margin-bottom: 24px; }
.comment-body { display: flex; gap: 14px; }
.comment-avatar img { border-radius: 50%; }
.comment-content-wrap { flex: 1; }
.comment-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-date { font-size: 0.82rem; color: var(--text-dim); }
.comment-text { color: var(--text-muted); }
.comment-text p { margin: 0 0 8px; }
.comment-actions { margin-top: 6px; font-size: 0.85rem; }
.comment-actions a { color: var(--accent); }
.comment-reply-title { font-size: 1.3rem; margin: 28px 0 14px; }
.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-family: var(--font-body);
}
.comment-form textarea { min-height: 130px; }
.comment-form input[type="submit"] {
    padding: 12px 28px; border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--accent-dark); }

/* Empty */
.empty-state { text-align: center; color: var(--text-muted); padding: 48px 20px; font-style: italic; }

/* Contact page */
.contact-page { max-width: 1000px; margin: 0 auto; }
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
    margin: 32px 0;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-card {
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.contact-card h3 {
    font-family: var(--font-display); font-size: 1.1rem;
    margin: 0 0 8px; color: var(--accent);
}
.contact-card p { color: var(--text-muted); margin: 0 0 4px; font-size: 0.95rem; }
.contact-card a { color: var(--accent); }
.contact-note { font-style: italic; font-size: 0.85rem; color: var(--text-dim); }
.contact-content { margin-top: 24px; }
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

/* Back to top */
#backToTop {
    position: fixed; bottom: 24px; right: 24px;
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 1.4rem;
    cursor: pointer; opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 200;
}
#backToTop.visible { opacity: 1; pointer-events: auto; }
#backToTop:hover { transform: translateY(-2px); background: var(--accent-dark); }

/* Services page cards */
.services-page { max-width: 1100px; margin: 0 auto; }
.services-header { text-align: center; margin-bottom: 40px; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.service-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s var(--ease), box-shadow 0.3s;
    display: flex; flex-direction: column;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.service-card-header {
    background: var(--accent);
    color: #fff;
    padding: 20px 24px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}
.service-card-header h2, .service-card-header h3 {
    color: #fff; margin: 0; font-size: 1.15rem; font-family: var(--font-display);
}
.service-card-body {
    padding: 20px 24px 24px;
    flex: 1;
}
.service-card-body p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 12px; }
.service-card-body ul { padding-left: 18px; margin: 0; }
.service-card-body li { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 6px; line-height: 1.5; }
.service-card-body strong { color: var(--text); }
.info-card .service-card-header {
    background: var(--accent-soft);
    color: var(--accent);
}
.info-card .service-card-header h2, .info-card .service-card-header h3 {
    color: var(--accent);
}
.info-sections {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px;
}
.services-extra { margin-top: 32px; text-align: center; }
.services-extra img { max-width: 400px; margin: 0 auto; border-radius: var(--radius); }
.services-extra .afsrb-link { margin-top: 12px; }
@media (max-width: 768px) {
    .info-sections { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .services-grid { grid-template-columns: 1fr; }
}

/* Featured obituary */
.featured-obituary { margin-bottom: 56px; }
.featured-card {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-hover);
}
.featured-thumb { display: block; overflow: hidden; background: var(--line-soft); }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.featured-card:hover .featured-thumb img { transform: scale(1.04); }
.featured-thumb-placeholder { width: 100%; height: 100%; min-height: 320px; background: linear-gradient(135deg, var(--line-soft), var(--accent-soft)); }
.featured-info { padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 12px;
}
.featured-title { font-size: 1.8rem; margin: 0 0 14px; line-height: 1.2; }
.featured-title a { color: var(--text); }
.featured-title a:hover { color: var(--accent); }
.featured-excerpt { color: var(--text-muted); font-size: 1rem; line-height: 1.7; margin-bottom: 24px; }
@media (max-width: 768px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-thumb img { max-height: 320px; }
}

/* Archive grid (larger cards) */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}
.archive-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
    display: flex; flex-direction: column;
}
.archive-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-soft);
}
.archive-thumb { display: block; aspect-ratio: 4/3; overflow: hidden; background: var(--line-soft); }
.archive-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.archive-card:hover .archive-thumb img { transform: scale(1.05); }
.archive-thumb-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--line-soft), var(--accent-soft)); }
.archive-info { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.archive-title-card { font-size: 1.25rem; margin: 0 0 4px; line-height: 1.3; }
.archive-title-card a { color: var(--text); }
.archive-title-card a:hover { color: var(--accent); }
.archive-date { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 4px; font-style: italic; }
.archive-dates { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 10px; }
.archive-filter { margin-bottom: 32px; }
.archive-excerpt { font-size: 0.95rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.6; flex: 1; }
.archive-card .read-more { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* Filter bar */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; justify-content: center; }
.filter-label { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.filter-list { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; }
.filter-list li a {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
    transition: all 0.2s;
}
.filter-list li a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filter-list li a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-list li a.active:hover { background: var(--accent-dark); color: #fff; }
.month-filter { margin-top: -12px; margin-bottom: 24px; }
.month-filter .filter-list li a { font-size: 0.8rem; padding: 4px 10px; }

/* Search hero */
.search-hero { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.search-form-wrap { max-width: 520px; margin: 20px auto 0; }
.search-results-count { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }
.search-excerpt { font-size: 0.88rem; color: var(--text-muted); margin: 4px 16px 8px; line-height: 1.5; }
.no-results { text-align: center; padding: 40px 20px; }
.empty-hint { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 20px; }
.btn-primary {
    display: inline-block; padding: 12px 28px; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-weight: 600;
    transition: background 0.2s; border: none; cursor: pointer; text-decoration: none;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

/* Services page styling */
.entry-content h2 {
    font-size: 1.6rem; margin: 40px 0 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Services page: style raw content as cards (fallback when template not applied) */
.services-page-body .entry-content strong {
    display: block;
    background: var(--accent);
    color: #fff;
    padding: 14px 20px;
    margin: 24px 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}
.services-page-body .entry-content ul {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px 20px 20px 36px;
    margin: 0 0 24px;
    box-shadow: var(--shadow);
}
.services-page-body .entry-content ul li { margin: 0 0 6px; }
.services-page-body .entry-content p:has(strong) { margin: 0; }
.entry-content h3 { font-size: 1.25rem; margin: 24px 0 8px; color: var(--accent); }
.entry-content ul { padding-left: 20px; margin: 0 0 20px; }
.entry-content li { margin: 0 0 6px; color: var(--text-muted); }
.entry-content strong { color: var(--text); }
.entry-content p { color: var(--text-muted); }

/* Contact page */
.contact-info-block { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); margin: 24px 0; }
.contact-info-block h3 { margin: 0 0 8px; }

/* Hide old contact page content (rendered by stale template) */
.contact-page-body .site-main,
.contact-page-body .entry-content,
.contact-page-body .contact-content,
.contact-page-body .entry-header { display: none !important; }

/* Premium card hover */
.obituary-card, .slide-card { transition: transform 0.35s var(--ease), box-shadow 0.35s; }

/* Smooth image loading */
.obituary-thumb img, .slide-thumb img { transition: transform 0.5s var(--ease); }

/* Slider */
.obituary-slider-section { margin-bottom: 56px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-subtitle { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.section-title { font-size: 1.8rem; margin: 0 0 8px; }
.slider-wrap { position: relative; display: flex; align-items: center; gap: 12px; }
.obituary-slider {
    display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; flex: 1; padding: 8px 4px 16px;
    scrollbar-width: none;
}
.obituary-slider::-webkit-scrollbar { display: none; }
.slide-card {
    flex: 0 0 260px; scroll-snap-align: start;
    background: var(--surface); border: 1px solid var(--line-soft);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.slide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.slide-thumb { display: block; aspect-ratio: 3/4; overflow: hidden; background: var(--line-soft); }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.slide-card:hover .slide-thumb img { transform: scale(1.05); }
.slide-thumb-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--line-soft), var(--accent-soft)); }
.slide-title { font-size: 1rem; margin: 12px 14px 4px; line-height: 1.3; }
.slide-title a { color: var(--text); }
.slide-title a:hover { color: var(--accent); }
.slide-dates { font-size: 0.8rem; color: var(--text-dim); margin: 0 14px 8px; font-style: italic; }
.slide-card .read-more { margin: 0 14px 14px; font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.slider-btn {
    flex: 0 0 44px; height: 44px; border: none; border-radius: 50%;
    background: var(--surface); box-shadow: var(--shadow);
    color: var(--accent); font-size: 1.6rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.slider-btn:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.slider-dots button {
    width: 8px; height: 8px; border-radius: 50%; border: none;
    background: var(--line); cursor: pointer; padding: 0; transition: background 0.2s, transform 0.2s;
}
.slider-dots button.active { background: var(--accent); transform: scale(1.3); }

/* 404 */
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 h1 { font-size: 4rem; color: var(--accent); }
.error-404 p { color: var(--text-muted); margin: 12px 0 24px; }

/* Responsive */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr !important; }
    .sidebar { position: static; }
    .post-nav { grid-template-columns: 1fr; }
    .featured-card { grid-template-columns: 1fr; }
    .featured-thumb img { max-height: 320px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .header-hero { min-height: 180px; }
    .site-header { position: relative; }
    .header-hero-overlay { padding: 24px 0 16px; }
    .hero-title { font-size: 1.5rem; }
    .hero-tagline { font-size: 0.85rem; }
    .hero-phone { font-size: 1.1rem; }
    .header-hero-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .hero-actions { align-items: flex-start; width: 100%; }
    .hero-nav .nav-list { flex-direction: column; gap: 4px; }
    .hero-nav .nav-list a {
        display: block; padding: 10px 14px; border-radius: 6px;
        background: rgba(255,255,255,0.15);
    }
    .hero-phone { font-size: 1.3rem; }
    .hero-search-form { max-width: 100%; }
    .hero-search-bar { padding: 12px 0 4px; }
    .page-title { font-size: 1.8rem; }
    .section-title { font-size: 1.5rem; }
    .obituary-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .obituary-title { font-size: 0.95rem; margin: 10px 12px 4px; }
    .obituary-dates { font-size: 0.78rem; margin: 0 12px 4px; }
    .obituary-excerpt { font-size: 0.8rem; margin: 0 12px 8px; }
    .obituary-card .read-more { margin: 0 12px 12px; font-size: 0.78rem; }
    .slide-card { flex: 0 0 200px; }
    .filter-bar { gap: 8px; }
    .filter-list li a { font-size: 0.78rem; padding: 4px 10px; }
    .footer-contact { grid-template-columns: 1fr; gap: 20px; }
    .single-obituary .entry-title { font-size: 1.6rem; }
    .entry-content { font-size: 1rem; }
    .memorial-actions { flex-direction: column; }
    .action-btn { text-align: center; }
    .archive-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .featured-info { padding: 24px 20px; }
    .featured-title { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .obituary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .obituary-title { font-size: 0.85rem; }
    .hero-search-form { flex-direction: column; }
    .hero-search-form button { width: 100%; }
    .slider-btn { display: none; }
    .page-title { font-size: 1.5rem; }
    .obituary-dates { display: none; }
    .obituary-excerpt { display: none; }
}

/* Touch-friendly */
@media (hover: none) {
    .obituary-card:hover { transform: none; }
    .obituary-card:hover .obituary-thumb img { transform: none; }
    .slide-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Print */
@page { margin: 1.5cm; }
@media print {
    .site-header, .site-footer, .sidebar, .slider-wrap, .slider-dots,
    .pagination, .post-nav, .comment-form, .memorial-actions,
    .post-meta, .post-meta-bottom, .comment-list, .comments-area,
    .filter-bar, .home-search, .featured-obituary, .obituary-slider-section,
    #backToTop, .nav-toggle { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    .single-obituary { max-width: 100%; }
    .single-obituary .entry-content { font-size: 11pt; line-height: 1.6; color: #000; }
    .single-obituary .entry-title { font-size: 18pt; margin-bottom: 12pt; }
    .obituary-photo { text-align: center; margin-bottom: 16pt; }
    .obituary-photo img { max-width: 200px; margin: 0 auto; }
    body { background: #fff; color: #000; font-family: Georgia, serif; }
    a { color: #000; text-decoration: none; }
    .entry-content a { border-bottom: none; }
}
