/* ============================================================================
   Bending Fences Enterprise - design system (Phase 1)
   Palette: deep pine / moss greens, warm cream, brass, blaze-orange accent.
   System fonts only - no CDNs, nothing external to fail or track.
   Referenced with a cache buster (?v=) from Site.master: bump the version in
   the SAME batch as any change to this file.
   ========================================================================= */

:root {
    --pine:   #1e2a20;   /* darkest green - header, footer, hero */
    --moss:   #2e4034;   /* mid green - panels on dark */
    --fern:   #48604f;   /* light green - borders, quiet accents */
    --cream:  #f7f4ec;   /* page background */
    --paper:  #fffdf7;   /* cards on cream */
    --ink:    #232a24;   /* body text on light */
    --faded:  #5c665e;   /* secondary text on light */
    --brass:  #d9c58f;   /* headings on dark, rules, highlights */
    --blaze:  #b8502a;   /* blaze orange - primary action color */
    --blaze-dark: #96401f;
}

/* ---- Reset & base ------------------------------------------------------ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
}

h1, h2, h3, h4 {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.25;
    margin: 0 0 0.6em;
    color: var(--pine);
}

h1 { font-size: 2.4rem; letter-spacing: 0.02em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--blaze-dark); }
a:hover { color: var(--blaze); }

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* Accessibility: keyboard skip link */
.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--brass); color: var(--pine);
    padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Header ------------------------------------------------------------ */

.site-header {
    background: var(--pine);
    border-bottom: 3px solid var(--brass);
}

.header-row {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 0.75rem;
    padding-top: 0.9rem; padding-bottom: 0.9rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }

.brand-mark {
    display: flex; align-items: center; justify-content: center;
    width: 2.6rem; height: 2.6rem;
    border: 2px solid var(--brass); border-radius: 50%;
    color: var(--brass); font-family: Georgia, serif;
    font-weight: bold; letter-spacing: 0.05em;
}

.brand-text {
    color: #f2efe6; font-family: Georgia, serif;
    font-size: 1.25rem; line-height: 1.15;
}

.brand-sub {
    display: block; color: var(--brass);
    font-size: 0.72rem; letter-spacing: 0.28em;
    text-transform: uppercase;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.site-nav a {
    color: #f2efe6; text-decoration: none;
    padding: 0.45rem 0.85rem; border-radius: 4px;
    font-size: 0.98rem;
}

.site-nav a:hover { background: var(--moss); color: var(--brass); }

/* ---- Hero -------------------------------------------------------------- */

.hero {
    background: linear-gradient(160deg, var(--pine) 0%, var(--moss) 100%);
    color: #f2efe6;
    padding: 4.5rem 0 4rem;
}

.hero h1 { color: var(--brass); font-size: 2.9rem; margin-bottom: 0.35em; }

.hero .tagline {
    font-family: Georgia, serif; font-style: italic;
    font-size: 1.35rem; color: #f2efe6; margin-bottom: 1.1em;
}

.hero p.lead { max-width: 38rem; font-size: 1.12rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
    display: inline-block; text-decoration: none;
    padding: 0.7rem 1.4rem; border-radius: 4px;
    font-weight: 600; font-size: 1rem; line-height: 1.2;
    border: 2px solid transparent;
}

.btn-primary { background: var(--blaze); color: #fff; }
.btn-primary:hover { background: var(--blaze-dark); color: #fff; }

.btn-ghost { border-color: var(--brass); color: var(--brass); background: transparent; }
.btn-ghost:hover { background: var(--brass); color: var(--pine); }

/* On light sections the ghost button flips to pine */
.on-light .btn-ghost { border-color: var(--pine); color: var(--pine); }
.on-light .btn-ghost:hover { background: var(--pine); color: var(--cream); }

/* ---- Sections ----------------------------------------------------------- */

.section { padding: 3.5rem 0; }

.section-tight { padding: 2.25rem 0; }

.section-dark {
    background: var(--pine); color: #f2efe6;
}
.section-dark h2, .section-dark h3 { color: var(--brass); }

.kicker {
    text-transform: uppercase; letter-spacing: 0.22em;
    font-size: 0.78rem; font-weight: 700; color: var(--blaze-dark);
    margin-bottom: 0.4rem;
}
.section-dark .kicker { color: var(--brass); }

.rule {
    width: 4rem; border: 0; border-top: 3px solid var(--brass);
    margin: 0 0 1.5rem;
}

/* ---- Cards -------------------------------------------------------------- */

.card-grid {
    display: grid; gap: 1.4rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin-top: 1.8rem;
}

.card {
    background: var(--paper);
    border: 1px solid #e5dfd0;
    border-top: 4px solid var(--fern);
    border-radius: 6px;
    padding: 1.5rem 1.4rem;
}

.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.section-dark .card {
    background: var(--moss); border-color: var(--fern);
    border-top-color: var(--brass); color: #f2efe6;
}

/* ---- Split (text + aside) ---------------------------------------------- */

.split {
    display: grid; gap: 2.25rem;
    grid-template-columns: 3fr 2fr;
    align-items: start;
}

@media (max-width: 44rem) {
    .split { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    h1 { font-size: 2rem; }
}

.quote-panel {
    background: var(--moss); color: #f2efe6;
    border-left: 4px solid var(--brass);
    border-radius: 6px; padding: 1.6rem 1.5rem;
    font-family: Georgia, serif; font-style: italic; font-size: 1.15rem;
}

.quote-panel .attrib {
    display: block; margin-top: 0.9rem;
    font-style: normal; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--brass);
}

/* ---- Value / step lists -------------------------------------------------- */

.value-list { list-style: none; margin: 1.4rem 0 0; padding: 0; }

.value-list li {
    padding: 0.85rem 0 0.85rem 1.6rem;
    border-bottom: 1px solid #e5dfd0;
    position: relative;
}

.value-list li::before {
    content: ""; position: absolute; left: 0; top: 1.45rem;
    width: 0.65rem; height: 0.65rem;
    background: var(--blaze); transform: rotate(45deg);
}

.value-list strong { color: var(--pine); }

.steps { counter-reset: step; list-style: none; margin: 1.6rem 0 0; padding: 0; }

.steps li {
    counter-increment: step;
    display: flex; gap: 1.1rem; align-items: flex-start;
    padding: 0.9rem 0;
}

.steps li::before {
    content: counter(step);
    flex: 0 0 2.2rem; height: 2.2rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--pine); color: var(--brass);
    border-radius: 50%; font-family: Georgia, serif; font-weight: bold;
}

/* ---- Gallery placeholder grid ------------------------------------------- */

.gallery-grid {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    margin-top: 1.8rem;
}

.gallery-tile {
    aspect-ratio: 4 / 3;
    background: linear-gradient(150deg, var(--moss), var(--pine));
    border: 1px solid var(--fern);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 1rem;
    color: var(--brass); font-family: Georgia, serif; font-style: italic;
}

/* ---- CTA band ------------------------------------------------------------ */

.cta-band {
    background: var(--blaze); color: #fff;
    padding: 2.75rem 0;
}

.cta-band h2 { color: #fff; margin-bottom: 0.3em; }
.cta-band p { max-width: 42rem; margin-bottom: 1.2rem; }
.cta-band .btn-ghost { border-color: #fff; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--blaze-dark); }

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
    background: var(--pine); color: #cfd6cf;
    border-top: 3px solid var(--brass);
    margin-top: 0; font-size: 0.95rem;
}

.footer-grid {
    display: grid; gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    padding-top: 2.5rem; padding-bottom: 1.5rem;
}

.footer-brand {
    font-family: Georgia, serif; font-size: 1.15rem;
    color: #f2efe6; margin-bottom: 0.2rem;
}

.footer-tag { font-style: italic; color: var(--brass); }

.footer-links { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-links a { color: #cfd6cf; text-decoration: none; }
.footer-links a:hover { color: var(--brass); }

.footer-legal {
    border-top: 1px solid var(--moss);
    padding-top: 1rem; padding-bottom: 1.25rem;
    font-size: 0.85rem; color: #9aa69c;
}

/* ============================================================================
   Portal & forms (Increment 4 - /BFE/portal/). Cache buster bumped to
   ?v=20260721b in Site.master and Portal.master with this change.
   ========================================================================= */

.portal-body { background: #ece8dc; }

.portal-main { padding: 2.25rem 0 3.5rem; }

.portal-userbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    background: var(--paper); border: 1px solid #e5dfd0; border-radius: 6px;
    padding: 0.6rem 1rem; margin-bottom: 1.75rem;
    font-size: 0.95rem; color: var(--faded);
}

.btn-small { padding: 0.35rem 0.9rem; font-size: 0.9rem; }

.btn-block { display: block; width: 100%; text-align: center; }

/* ---- Login screen -------------------------------------------------------- */

.login-body {
    background: linear-gradient(160deg, var(--pine) 0%, var(--moss) 100%);
    min-height: 100vh; margin: 0;
}

.login-wrap {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center; padding: 1.5rem;
}

.login-card {
    background: var(--paper); border-radius: 8px;
    border-top: 5px solid var(--brass);
    padding: 2.25rem 2rem; width: 100%; max-width: 24rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-card h1 { font-size: 1.5rem; margin-bottom: 0.15em; }

.login-mark {
    width: 3rem; height: 3rem; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--pine); border-radius: 50%;
    color: var(--pine); font-family: Georgia, serif; font-weight: bold;
}

.login-sub {
    color: var(--faded); font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.18em;
    margin-bottom: 1.4rem;
}

.login-note { font-size: 0.85rem; color: var(--faded); margin: 1.1rem 0 0; }

/* ---- Form primitives ------------------------------------------------------ */

.form-narrow { max-width: 26rem; }

.form-field { margin-bottom: 1.1rem; }

.form-field label {
    display: block; font-weight: 600; font-size: 0.92rem;
    margin-bottom: 0.3rem; color: var(--pine);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field textarea,
.form-field select {
    width: 100%; padding: 0.6rem 0.7rem;
    border: 1px solid #c9c2af; border-radius: 4px;
    font: inherit; color: var(--ink); background: #fff;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: 2px solid var(--fern); border-color: var(--fern);
}

.form-error {
    display: block; color: #8c2f16; font-weight: 600; margin-bottom: 0.9rem;
}
.form-error:empty { display: none; }

.form-success {
    display: block; color: #2e5d38; font-weight: 600; margin-bottom: 0.9rem;
}
.form-success:empty { display: none; }

.form-notice {
    background: #f6ecd8; border-left: 4px solid var(--brass);
    padding: 0.75rem 1rem; border-radius: 4px;
}

/* ============================================================================
   Contact intake + portal messages (Increment 5). Cache buster bumped to
   ?v=20260721c in Site.master, Portal.master, and login.aspx with this change.
   ========================================================================= */

/* Honeypot: off-screen, invisible to humans, present for bots. Never use
   display:none (naive bots skip those); off-screen positioning catches more. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 1px; width: 1px; overflow: hidden;
}

.msg-card {
    background: var(--paper);
    border: 1px solid #e5dfd0;
    border-left: 4px solid #c9c2af;
    border-radius: 6px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.1rem;
}

.msg-unread {
    border-left-color: var(--blaze);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.msg-head {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
    justify-content: space-between; align-items: baseline;
    margin-bottom: 0.6rem;
}

.msg-from { font-weight: 700; color: var(--pine); overflow-wrap: anywhere; }

.msg-meta {
    font-size: 0.82rem; color: var(--faded);
    text-transform: uppercase; letter-spacing: 0.08em;
}

.msg-unread .msg-meta { color: var(--blaze-dark); }

.msg-body {
    border-top: 1px solid #efe9da;
    padding-top: 0.6rem; margin-bottom: 0.8rem;
    overflow-wrap: anywhere;
}

.msg-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ============================================================================
   Gallery (Increment 6). Cache buster bumped to ?v=20260721d in Site.master,
   Portal.master, and login.aspx with this change.
   ========================================================================= */

/* Public gallery photos */
.gallery-photo-grid {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    margin-top: 1.8rem;
}

.gallery-photo {
    margin: 0; background: var(--paper);
    border: 1px solid #e5dfd0; border-radius: 6px;
    overflow: hidden;
}

.gallery-photo img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
}

.gallery-photo figcaption {
    padding: 0.6rem 0.9rem; font-size: 0.92rem; color: var(--faded);
    font-family: Georgia, serif; font-style: italic;
}

/* Portal gallery manager */
.gal-upload { margin-bottom: 2rem; max-width: 30rem; }

.gal-manage-grid {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.gal-manage-card {
    background: var(--paper); border: 1px solid #e5dfd0;
    border-radius: 6px; overflow: hidden;
}

.gal-manage-card img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
}

.gal-manage-card.gal-hidden { opacity: 0.55; }
.gal-manage-card.gal-hidden img { filter: grayscale(0.8); }

.gal-manage-body { padding: 0.8rem 0.9rem; }

.gal-manage-body input[type="text"] {
    width: 100%; padding: 0.45rem 0.6rem; margin: 0.45rem 0 0.6rem;
    border: 1px solid #c9c2af; border-radius: 4px; font: inherit;
}
