/* ═══════════════════════════════════════════════════════════
   POW HERITAGE — Custom WordPress Theme
   Preservation of Wilson · preservationofwilson.com
   Designed by DAEDALUS Design Agent + Pencil MCP
   ═══════════════════════════════════════════════════════════ */

@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;1,700&family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap");

/* ── Tokens ── */
:root {
    --pow-red: #8B2332;
    --pow-red-dark: #6B1A27;
    --pow-dark: #333333;
    --pow-medium: #666666;
    --pow-light: #999999;
    --pow-cream: #FAF9F7;
    --pow-warm: #F5F0E8;
    --pow-footer: #C5C0B6;
    --pow-white: #FFFFFF;
    --pow-border: #E8E4DF;
    --pow-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --pow-sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --pow-transition: 0.3s ease;
    --pow-max-width: 1200px;
    --pow-content-width: 900px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--pow-sans);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.8;
    color: var(--pow-dark);
    background-color: var(--pow-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--pow-serif);
    font-weight: 400;
    line-height: 1.3;
    color: var(--pow-dark);
    letter-spacing: 0.02em;
    margin-top: 0;
}
h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.6rem; margin-bottom: 0.8rem; }
h4 { font-size: 1.3rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1.4em; color: #555; }

a {
    color: var(--pow-red);
    text-decoration: none;
    transition: color var(--pow-transition);
}
a:hover { color: var(--pow-red-dark); }

::selection { background-color: var(--pow-red); color: var(--pow-white); }

/* ═══════════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════════ */
.site-header {
    background-color: var(--pow-white);
    border-bottom: 1px solid var(--pow-border);
}

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

/* Brand: logo icon + text on one line */
.site-branding { flex-shrink: 0; }

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    border-bottom: none !important;
}

.brand-link .custom-logo {
    height: 38px;
    width: auto;
    display: block;
}

.brand-text {
    font-family: var(--pow-serif);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pow-red);
    white-space: nowrap;
    line-height: 1;
}
.brand-link:hover .brand-text { color: var(--pow-red-dark); }

/* Right side: nav + social */
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ═══════════════════════════════════════════
   NAVIGATION — inline in header row
   ═══════════════════════════════════════════ */
.site-nav {
    display: flex;
    align-items: center;
}

/* Social icons li — between nav links and Join Us button */
.primary-menu > li.social-li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
}
.primary-menu > li.social-li::before { display: none; }
.primary-menu > li.social-li a.social-icon {
    display: flex;
    align-items: center;
    color: var(--pow-dark);
    padding: 4px 2px;
    border-bottom: none !important;
    transition: color var(--pow-transition);
}
.primary-menu > li.social-li a.social-icon:hover {
    color: var(--pow-red);
    border-bottom: none !important;
}

/* Reorder: social-li (DOM last) displays before Join Us (DOM second-to-last) */
.primary-menu > li:nth-last-child(2) { order: 2; }  /* Join Us → end */
.primary-menu > li.social-li { order: 1; }           /* Social → before Join Us */

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: block;
    padding: 22px 9px;
    color: var(--pow-dark);
    font-family: var(--pow-sans);
    font-size: 10.5px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--pow-transition);
    border-bottom: 2px solid transparent;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-menu-ancestor > a {
    color: var(--pow-red);
    border-bottom-color: var(--pow-red);
}

/* Join Us — second-to-last item (before social li) styled as button */
.primary-menu > li:nth-last-child(2) > a {
    background-color: var(--pow-red);
    color: var(--pow-white);
    border-radius: 2px;
    padding: 9px 16px;
    margin-left: 4px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-bottom: none;
}
.primary-menu > li:nth-last-child(2) > a:hover {
    background-color: var(--pow-red-dark);
    color: var(--pow-white);
}

/* Dropdown */
.primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--pow-white);
    border-top: 3px solid var(--pow-red);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
}
.primary-menu li:hover > .sub-menu { display: block; }

.primary-menu .sub-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pow-dark);
    border-bottom: 1px solid var(--pow-border);
    text-decoration: none;
    transition: all var(--pow-transition);
}
.primary-menu .sub-menu li:last-child a { border-bottom: none; }
.primary-menu .sub-menu li a:hover {
    color: var(--pow-red);
    background-color: var(--pow-cream);
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--pow-red);
    color: var(--pow-red);
    padding: 8px 16px;
    font-family: var(--pow-sans);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    margin: 12px auto;
}

/* ═══════════════════════════════════════════
   CONTENT
   ═══════════════════════════════════════════ */
.site-content {
    min-height: 60vh;
}

.content-area {
    max-width: var(--pow-content-width);
    margin: 0 auto;
    padding: 60px 40px;
}

/* Full-width content for front page */
.home .content-area {
    max-width: 100%;
    padding: 0;
}

/* Inner page header banner (fallback — no featured image) */
.page-header {
    background-color: var(--pow-warm);
    text-align: center;
    padding: 50px 40px 42px;
    border-bottom: 3px solid var(--pow-red);
    margin-bottom: 0;
}

.page-header h1 {
    font-family: var(--pow-serif);
    font-size: 2.8rem;
    font-weight: 300;
    font-style: italic;
    color: var(--pow-dark);
    margin: 0;
}

/* Inner page hero banner (with featured image) */
.page-hero {
    width: 100%;
    margin-bottom: 0;
}
.page-hero-image {
    width: 100%;
    min-height: 300px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-hero-overlay {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
}
.page-hero-overlay h1 {
    font-family: var(--pow-serif);
    font-size: 3rem;
    font-weight: 300;
    font-style: italic;
    color: var(--pow-white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    letter-spacing: 0.04em;
    margin: 0;
    text-align: center;
    padding: 0 40px;
}

/* Entry content */
.entry-content a { border-bottom: 1px solid transparent; }
.entry-content a:hover { border-bottom-color: var(--pow-red); }

/* ═══════════════════════════════════════════
   COVER / HERO BLOCKS
   ═══════════════════════════════════════════ */
.wp-block-cover {
    min-height: 520px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wp-block-cover .wp-block-cover__inner-container {
    text-align: center;
    max-width: 800px;
    padding: 40px;
}
.wp-block-cover h2 {
    font-family: var(--pow-serif);
    font-size: 3.2rem;
    font-weight: 300;
    font-style: italic;
    color: var(--pow-white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.wp-block-button__link,
.pow-btn {
    display: inline-block;
    background-color: var(--pow-red);
    color: var(--pow-white);
    font-family: var(--pow-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--pow-transition);
}
.wp-block-button__link:hover,
.pow-btn:hover {
    background-color: var(--pow-red-dark);
    color: var(--pow-white);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--pow-red);
    border: 2px solid var(--pow-red);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--pow-red);
    color: var(--pow-white);
}

/* ═══════════════════════════════════════════
   CONTENT ELEMENTS
   ═══════════════════════════════════════════ */
blockquote {
    border-left: 3px solid var(--pow-red);
    padding: 20px 30px;
    margin: 2rem 0;
    background-color: var(--pow-warm);
    font-family: var(--pow-serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--pow-medium);
}
blockquote cite {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--pow-light);
    letter-spacing: 0.05em;
}

ul { list-style: none; padding-left: 0; }
ul li {
    padding: 6px 0 6px 24px;
    position: relative;
}
ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    background-color: var(--pow-red);
    border-radius: 50%;
    opacity: 0.6;
}
ol { padding-left: 24px; }
ol li { padding: 6px 0; }

/* Restore nav list styling */
.primary-menu, .primary-menu .sub-menu { list-style: none; }
.primary-menu li::before, .primary-menu .sub-menu li::before { display: none; }

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--pow-border), var(--pow-red), var(--pow-border), transparent);
    margin: 3rem 0;
}

/* Alignments */
.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}
.alignwide {
    max-width: var(--pow-content-width);
    margin-left: auto;
    margin-right: auto;
}

/* Media + Text blocks */
.wp-block-media-text {
    display: grid;
    grid-template-columns: 50% 1fr;
    margin-bottom: 0;
    border-bottom: 1px solid var(--pow-border);
}
.wp-block-media-text.has-media-on-the-right {
    grid-template-columns: 1fr 50%;
}
.wp-block-media-text__media {
    margin: 0;
    overflow: hidden;
}
.wp-block-media-text__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.wp-block-media-text:hover .wp-block-media-text__media img {
    transform: scale(1.03);
}
.wp-block-media-text__content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wp-block-media-text__content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}
.wp-block-media-text__content p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Columns */
.wp-block-columns {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}
.wp-block-column {
    flex: 1;
    min-width: 250px;
}
.wp-block-column h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }

/* Group blocks */
.wp-block-group.alignwide {
    max-width: var(--pow-content-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 40px;
    padding-right: 40px;
}

/* Separator */
.wp-block-separator.alignwide {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════
   BLOG / NEWS
   ═══════════════════════════════════════════ */
.post-list article {
    border-bottom: 1px solid var(--pow-border);
    padding-bottom: 3rem;
    margin-bottom: 3rem;
}
.post-list article:last-child { border-bottom: none; }

.post-meta {
    font-family: var(--pow-sans);
    font-size: 0.85rem;
    color: var(--pow-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}
.post-meta a { color: var(--pow-light); }
.post-meta a:hover { color: var(--pow-red); }

.post-title {
    font-family: var(--pow-serif);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}
.post-title a { color: var(--pow-dark); text-decoration: none; }
.post-title a:hover { color: var(--pow-red); }

/* ═══════════════════════════════════════════
   FORMS (WPForms)
   ═══════════════════════════════════════════ */
.wpforms-container .wpforms-form .wpforms-field-label {
    font-family: var(--pow-sans);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--pow-dark);
}
.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container input[type="tel"],
.wpforms-container textarea {
    border: 1px solid var(--pow-border);
    border-radius: 2px;
    padding: 12px 16px;
    font-family: var(--pow-sans);
    background-color: var(--pow-white);
    transition: border-color var(--pow-transition);
    width: 100%;
}
.wpforms-container input:focus,
.wpforms-container textarea:focus {
    border-color: var(--pow-red);
    outline: none;
    box-shadow: 0 0 0 2px rgba(139,35,50,0.1);
}
.wpforms-container .wpforms-submit {
    background-color: var(--pow-red);
    color: var(--pow-white);
    font-family: var(--pow-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 14px 40px;
    border-radius: 2px;
    border: none;
    cursor: pointer;
}
.wpforms-container .wpforms-submit:hover {
    background-color: var(--pow-red-dark);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
    background-color: var(--pow-footer);
    color: var(--pow-dark);
    padding: 50px 0 30px;
}
.footer-inner {
    max-width: var(--pow-content-width);
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}
.footer-inner p {
    font-family: var(--pow-serif);
    font-size: 0.9rem;
    color: var(--pow-medium);
}
.footer-inner a { color: var(--pow-dark); }
.footer-inner a:hover { color: var(--pow-red); }

.footer-contact {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.footer-social a {
    display: inline-block;
    margin: 0 8px;
    color: var(--pow-dark);
    font-size: 1.2rem;
    transition: color var(--pow-transition);
}
.footer-social a:hover { color: var(--pow-red); }

.site-info {
    font-size: 0.8rem;
    color: var(--pow-light);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pow-cream); }
::-webkit-scrollbar-thumb { background: var(--pow-footer); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--pow-red); }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    .site-title { font-size: 1.4rem; }
    .site-logo .custom-logo { max-height: 50px; }
    .content-area { padding: 30px 20px; }
    .header-inner { padding: 16px 20px 12px; }
    .nav-inner { padding: 0 20px; }
    .nav-menu-wrap { flex-direction: column; }
    .primary-menu { flex-direction: column; align-items: center; display: none; }
    .primary-menu.toggled { display: flex; }
    .header-inner { flex-direction: column; padding: 12px 20px; }
    .header-right { flex-direction: column; width: 100%; }
    .site-nav { width: 100%; }
    .primary-menu { flex-direction: column; align-items: center; display: none; }
    .primary-menu.toggled { display: flex; }
    .primary-menu > li > a { padding: 10px 16px; }
    .primary-menu > li:last-child > a { margin-left: 0; margin-top: 8px; }
    .primary-menu .sub-menu { position: static; box-shadow: none; border-top: none; }
    .menu-toggle { display: block; }
    .header-social { margin: 8px 0; }
    .page-header { padding: 30px 20px 25px; }
    .page-header h1 { font-size: 2rem; }
    .wp-block-cover h2 { font-size: 2.2rem; }
    .wp-block-columns { flex-direction: column; gap: 1.5rem; }
    .wp-block-media-text,
    .wp-block-media-text.has-media-on-the-right {
        grid-template-columns: 1fr;
    }
    .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
        order: -1;
    }
    .wp-block-media-text__content { padding: 24px 20px; }
    .footer-inner { padding: 0 20px; }
}
