/* ============================================================
   MEMORIAL SITE — SHARED STYLES
   Color and font values defined once here. To change the look
   later, only these variables need to change.
   ============================================================ */

@font-face {
    font-family: "Birthday Very Good";
    src: url("../fonts/birthdayverygood-webfont.woff2") format("woff2"),
         url("../fonts/birthdayverygood-webfont.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-primary: #37393A;
    --color-secondary: #FF5C5C;
    --color-accent: #77B6EA;
    --color-text: #37393A;
    --color-background: #E8EEF2;

    --font-heading: "Birthday Very Good", "Instrument Serif", serif;
    --font-body: "Libre Baskerville", serif;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: normal;
    font-size: 55px;
    color: var(--color-secondary);
    margin: 0 0 0.5em 0;
}

a {
    color: var(--color-secondary);
}

/* ---- Login page ---- */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(55, 57, 58, 0.35);
    border-radius: 10px;
    padding: 40px 32px;
}

.login-box h1 {
    font-size: 38px;
    text-align: center;
    margin-bottom: 4px;
}

.login-box .subtitle {
    text-align: center;
    font-size: 18px;
    opacity: 0.8;
    margin-bottom: 28px;
}

.field-group {
    margin-bottom: 18px;
}

.field-group label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.field-group input[type="text"],
.field-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(55, 57, 58, 0.4);
    background: rgba(55, 57, 58, 0.05);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 18px;
}

.field-group input:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background: var(--color-primary);
    color: var(--color-background);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
}

.btn-small {
    width: auto;
    padding: 8px 16px;
    font-size: 15px;
}

.error-message {
    background: rgba(200, 60, 60, 0.12);
    border: 1px solid rgba(200, 60, 60, 0.4);
    color: #a13a2f;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 18px;
    margin-bottom: 20px;
}

/* ---- Dashboard ---- */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid rgba(55, 57, 58, 0.25);
}

.dashboard-header h1 {
    font-size: 31px;
    margin: 0;
}

.dashboard-body {
    padding: 30px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

.filters a {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(55, 57, 58, 0.4);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.filters a.active {
    background: var(--color-primary);
    color: var(--color-background);
}

.story-row {
    border: 1px solid rgba(55, 57, 58, 0.25);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.story-row.is-hidden {
    opacity: 0.55;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    margin-bottom: 10px;
    opacity: 0.85;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-public {
    background: rgba(55, 57, 58, 0.3);
}

.badge-private {
    background: rgba(55, 57, 58, 0.1);
}

.badge-hidden {
    background: rgba(200, 60, 60, 0.2);
    color: #a13a2f;
}

.story-text {
    font-size: 18px;
    margin: 0 0 14px 0;
    white-space: pre-wrap;
}

.story-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.story-photos img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(55, 57, 58, 0.3);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
}

/* ============================================================
   PUBLIC HOMEPAGE
   ============================================================ */

.site-section {
    padding: 26px 24px;
    max-width: 760px;
    margin: 0 auto;
}

.site-section h2 {
    margin-bottom: 20px;
}

.placeholder-note {
    font-size: 18px;
    opacity: 0.75;
    font-style: normal;
    border-left: 3px solid var(--color-primary);
    padding-left: 16px;
}

.memory-card {
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 18px;
}

.memory-card .memory-text {
    font-size: 19px;
    line-height: 1.65;
    margin: 0 0 14px 0;
    white-space: pre-wrap;
}

.memory-card .memory-author {
    font-family: var(--font-body);
    font-size: 19px;
    color: var(--color-primary);
    margin: 0;
}

.memory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.memory-like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
}

.memory-like-heart {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 2px;
    transition: fill 0.15s ease, transform 0.15s ease;
}

.memory-like-btn:hover .memory-like-heart {
    transform: scale(1.1);
}

.memory-like-btn.liked .memory-like-heart {
    fill: var(--color-secondary);
}

.memory-like-count {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    opacity: 0.7;
    min-width: 12px;
}

.memory-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.memory-photos img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

/* ---- Submission form ---- */

.share-form {
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 10px;
    padding: 32px;
}

.share-form textarea,
.share-form input[type="text"],
.share-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(55, 57, 58, 0.4);
    background: rgba(55, 57, 58, 0.06);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 18px;
    resize: vertical;
}

.share-form textarea:focus,
.share-form input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.photo-input-row {
    margin-bottom: 10px;
}

.photo-input-row input[type="file"] {
    color: var(--color-text);
    font-size: 18px;
}

.form-success {
    background: rgba(129, 174, 157, 0.2);
    border: 1px solid rgba(129, 174, 157, 0.5);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.form-hint {
    font-size: 15px;
    opacity: 0.7;
    margin-top: 4px;
    margin-bottom: 0;
}

/* Mobile overrides for the viewfinder hero moved to the end of this
   file — see the bottom — since they need to come AFTER the base
   .vf-housing/.vf-knob/etc. rules to actually win the cascade. */

/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 30px;
}

@media (min-width: 640px) {
    .stat-cards { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 10px;
    padding: 18px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 33px;
    color: var(--color-text);
}

.stat-label {
    font-size: 15px;
    opacity: 0.75;
    margin-top: 4px;
}

.analytics-panel {
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
}

.analytics-panel h2 {
    margin-bottom: 16px;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.analytics-table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(55, 57, 58, 0.2);
}

.analytics-table td:last-child {
    text-align: right;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
}

.bar-label {
    width: 90px;
    flex-shrink: 0;
    opacity: 0.85;
}

.bar-track {
    flex-grow: 1;
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.bar-fill {
    background: var(--color-primary);
    height: 100%;
}

.bar-value {
    width: 45px;
    text-align: right;
    flex-shrink: 0;
    opacity: 0.75;
}

/* ============================================================
   VISUALLY HIDDEN (accessible text that's not shown visually —
   used for the <h1> behind the viewfinder logo)
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   VIEWFINDER HERO
   A physical-object-styled photo toy. Its housing/chrome colors
   are deliberately literal (meant to look like a real vintage
   viewfinder), not tied to the site's color variables — only the
   surrounding page background and the text below it use the
   site's normal palette/fonts.
   ============================================================ */

.viewfinder-hero {
    padding: 90px 24px 70px;
    display: flex;
    justify-content: center;
}

.vf-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
}

.vf-reel-wrap {
    position: relative;
    width: 600px;
    max-width: 90vw;
    display: flex;
    justify-content: center;
}

.vf-reel {
    position: absolute;
    top: -78px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    aspect-ratio: 2 / 1;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
    box-shadow:
        0 -3px 8px rgba(0,0,0,0.12) inset,
        0 8px 16px rgba(0,0,0,0.22);
    overflow: hidden;
    z-index: 1;
}

.vf-reel-disc {
    position: absolute;
    inset: 0;
    transform-origin: 50% 100%;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vf-reel-thumb {
    position: absolute;
    bottom: 0;
    left: 50%;
    border-radius: 5px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.35);
    border: 2px solid #fff;
    transform-origin: 50% 100%;
}

.vf-reel-thumb--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary), 0 2px 5px rgba(0,0,0,0.35);
}

.vf-reel-hub {
    position: absolute;
    bottom: -9px;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #999, #555 70%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 2;
}

.vf-housing {
    position: relative;
    z-index: 2;
    width: 600px;
    max-width: 90vw;
    padding: 44px 40px 40px;
    border-radius: 60px;
    background: linear-gradient(160deg, #c8503d 0%, #a5382a 55%, #7e2419 100%);
    box-shadow:
        0 12px 24px rgba(0,0,0,0.25),
        inset 0 2px 2px rgba(255,255,255,0.22),
        inset 0 -6px 10px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.vf-photo-rim {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 36px;
    padding: 18px;
    background: radial-gradient(circle at 35% 25%, #4a4a4a 0%, #222 55%, #050505 100%);
    box-shadow: inset 0 6px 14px rgba(0,0,0,0.7);
    display: flex;
    box-sizing: border-box;
}

.vf-photo-window {
    position: relative;
    flex: 1;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
}

.vf-photo-window img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vf-vignette {
    position: absolute;
    inset: 0;
    border-radius: 22px;
    box-shadow: inset 0 0 46px rgba(0,0,0,0.55);
    pointer-events: none;
}

.vf-snap-anim {
    animation: vf-snap 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vf-snap {
    0%   { transform: scale(0.94) rotate(-2deg); opacity: 0.4; }
    55%  { transform: scale(1.03) rotate(1deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.vf-logo-plate {
    width: 100%;
    margin-top: 32px;
    text-align: center;
    box-sizing: border-box;
}

.vf-logo-plate img {
    height: 104px;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.vf-knob {
    position: absolute;
    top: 6%;
    right: -98px;
    width: 130px;
    height: 130px;
    transform-origin: 18% 50%; /* matches the pivot's position within the SVG's viewBox */
    z-index: 3;
    touch-action: none;
    cursor: grab;
}

.vf-knob svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35));
}

.vf-knob:active { cursor: grabbing; }

.vf-hint {
    display: none;
    font-size: 15px;
    opacity: 0.65;
    text-align: center;
    max-width: 280px;
    margin: 4px 0 0;
}

/* ============================================================
   RECAPTCHA
   The floating badge is hidden per request. Google's terms
   require the disclosure text below to be shown somewhere
   visible in its place — see .recaptcha-disclosure, used near
   the submission form in index.php.
   ============================================================ */

.grecaptcha-badge {
    visibility: hidden;
}

.recaptcha-disclosure {
    font-size: 10px;
    opacity: 0.55;
    text-align: center;
    margin-top: 12px;
}

.recaptcha-disclosure a {
    text-decoration: underline;
}

/* ============================================================
   MEMORIAL SERVICE ANNOUNCEMENT CARD
   ============================================================ */

.event-card {
    border: 1px solid rgba(55, 57, 58, 0.3);
    border-radius: 10px;
    padding: 44px 32px;
    text-align: center;
}

.event-card-title {
    margin-bottom: 16px;
}

.event-card-lead {
    font-size: 18px;
    max-width: 480px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.event-card-date {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--color-secondary);
    margin: 24px 0 2px;
}

.event-card-venue {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 2px;
}

.event-card-address {
    font-size: 18px;
    opacity: 0.8;
    line-height: 1.6;
    margin: 0 0 6px;
}

.event-card-directions {
    font-size: 15px;
    margin: 0 0 24px;
}

.event-card-times {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.event-card-times span {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--color-secondary);
    border-radius: 24px;
    padding: 8px 24px;
}

.event-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    padding-top: 28px;
    border-top: 1px solid rgba(55, 57, 58, 0.2);
}

.event-card-detail h3 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-secondary);
    margin: 0 0 6px;
}

.event-card-detail p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0;
}

.event-card-cta {
    font-size: 18px;
    max-width: 480px;
    margin: 32px auto 0;
    padding-top: 28px;
    border-top: 1px solid rgba(55, 57, 58, 0.2);
    line-height: 1.6;
}

.event-card-cta a {
    font-weight: 700;
}

@media (max-width: 600px) {
    .event-card { padding: 32px 22px; }
    .event-card-details { grid-template-columns: 1fr; text-align: center; }
}

/* ============================================================
   CORNER LOGO HEADER
   A small logo, top-left, linking back to the homepage. Used on
   every page EXCEPT index.php itself (which already shows the logo
   prominently inside the viewfinder toy — a second copy there would
   be redundant).
   ============================================================ */

.corner-logo-header {
    padding: 24px 24px 0;
}

.corner-logo {
    display: block;
    width: 200px;
    height: 70px;
    background-color: var(--color-secondary);
    -webkit-mask: url('../logo_outlined.svg') no-repeat left center;
    mask: url('../logo_outlined.svg') no-repeat left center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* ============================================================
   MOBILE OVERRIDES — VIEWFINDER HERO
   Placed here, at the true end of the file, so these rules come
   AFTER every base .vf-* rule above and correctly win the cascade
   on mobile. (A previous version of this block sat earlier in the
   file, before .vf-housing's base rule — which meant the base rule,
   appearing later in source, silently won even on mobile widths.
   Any future mobile tweaks to these selectors belong HERE, not
   scattered earlier in the file.)
   ============================================================ */

@media (max-width: 600px) {
    .site-section { padding: 40px 20px; }
    .memory-photos img { width: 80px; height: 80px; }
    .vf-reel-wrap { max-width: 270px; }
    .vf-reel { top: -46px; }
    .vf-housing {
        width: 100%;
        max-width: 270px;
        padding: 26px 22px 22px;
        border-radius: 38px;
    }
    .vf-photo-rim { padding: 11px; border-radius: 22px; }
    .vf-photo-window, .vf-vignette { border-radius: 13px; }
    .vf-logo-plate img { height: 64px; }
    .vf-knob { width: 48px; height: 48px; right: -36px; }
}

/* ============================================================
   FACET POLAROIDS
   Placeholder colors stand in for real photos until those are
   gathered — swap the inline background on .facet-photo (or
   replace the span with an <img>) once photos exist.
   ============================================================ */

.facet-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px 30px;
    padding: 20px 0 30px;
}

@media (min-width: 601px) {
    .facet-grid {
        display: grid;
        grid-template-columns: repeat(2, 210px);
        justify-content: center;
    }
}

.facet-polaroid {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 210px;
    padding: 14px 14px 22px;
    background: #FDFCF9;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.facet-tilt-1 { transform: rotate(-4deg); }
.facet-tilt-2 { transform: rotate(3deg); }
.facet-tilt-3 { transform: rotate(-2.5deg); }
.facet-tilt-4 { transform: rotate(2.5deg); }
.facet-tilt-5 { transform: rotate(-3.5deg); }

.facet-polaroid:hover,
.facet-polaroid:focus {
    transform: rotate(0deg) scale(1.04) translateY(-6px);
    box-shadow: 0 16px 28px rgba(0,0,0,0.24);
}

.facet-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
}

.facet-label {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--color-text);
    margin-top: 14px;
}

@media (max-width: 600px) {
    .facet-polaroid { width: 44vw; max-width: 200px; padding: 10px 10px 18px; }
    .facet-label { font-size: 21px; margin-top: 10px; }
    .facet-grid { gap: 26px 18px; }
}

/* ============================================================
   SITE FOOTER
   Bookends every page. The heart is a real inline SVG shape,
   not the ❤️ emoji character, so it renders identically for
   everyone and can use the site's exact coral rather than
   whatever a given device's emoji font happens to draw.
   ============================================================ */

.site-footer {
    text-align: center;
    padding: 40px 20px 32px;
    margin-top: 20px;
}

.footer-tribute {
    font-size: 16px;
    opacity: 0.75;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.footer-heart {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.footer-login-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.4;
    text-decoration: none;
}

.footer-login-link:hover {
    opacity: 0.7;
}
