/* ============================================================
   In Memory — sailing-themed stylesheet
   ============================================================ */

:root {
    --navy-deep:    #0b2e4a;
    --navy:         #123a5c;
    --navy-light:   #1f5580;
    --sea:          #2b6f8f;
    --sea-light:    #a9c9d6;
    --foam:         #f6f8f9;
    --white:        #ffffff;
    --sand:         #d9c9a3;
    --wood:         #8a5a3b;
    --rope:         #b5895a;
    --ink:          #1c2b33;
    --ink-soft:     #4a5c66;
    --danger:       #a4372a;
    --success:      #2f6b4f;

    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius: 10px;
    --shadow-soft: 0 6px 24px rgba(11, 46, 74, 0.12);
    --shadow-lift: 0 10px 32px rgba(11, 46, 74, 0.18);
    --container-width: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--foam);
    line-height: 1.6;
}

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

a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--navy-deep);
    line-height: 1.15;
    margin: 0 0 0.5em;
    font-weight: 600;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.5rem; }

p { margin: 0 0 1em; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ---- Site header / nav ---------------------------------------- */

.site-header {
    background: linear-gradient(180deg, var(--navy-deep), var(--navy));
    color: var(--white);
    padding: 18px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

.brand:hover { text-decoration: none; opacity: 0.9; }

.brand svg { width: 28px; height: 28px; flex-shrink: 0; }

.site-nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--sea-light);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.site-nav a:hover { color: var(--white); }

/* ---- Wave divider ------------------------------------------------ */

.wave-divider {
    display: block;
    width: 100%;
    height: 42px;
    line-height: 0;
}

.wave-divider--top { background: var(--navy); }
.wave-divider--top svg { fill: var(--foam); }

.wave-divider--bottom svg { fill: var(--navy-deep); }

/* ---- Hero ---------------------------------------------------------- */

.hero {
    background: linear-gradient(180deg, var(--navy), var(--navy-light));
    color: var(--white);
    text-align: center;
    padding: 56px 0 0;
}

.hero-photo {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    margin: 0 auto 24px;
    border: 4px solid rgba(255,255,255,0.85);
    box-shadow: var(--shadow-lift);
    overflow: hidden;
    background: var(--sea-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-photo.is-placeholder { color: var(--navy); }
.hero-photo.is-placeholder svg { width: 64px; height: 64px; opacity: 0.6; }

.hero h1 { color: var(--white); margin-bottom: 0.15em; }

.hero .lifespan {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--sea-light);
    margin-bottom: 0.6em;
}

.hero .tagline {
    font-style: italic;
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto 40px;
    color: var(--sand);
}

/* ---- Buttons -------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
    background: var(--rope);
    color: var(--navy-deep);
    box-shadow: var(--shadow-soft);
}
.btn-primary:hover { box-shadow: var(--shadow-lift); }

.btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,0.7);
    color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-secondary {
    background: var(--navy);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-small { padding: 8px 16px; font-size: 0.85rem; }

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

/* ---- Sections --------------------------------------------------------- */

.section {
    padding: 56px 0;
}

.section--alt {
    background: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 8px;
}

.section-kicker {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    color: var(--rope);
    font-weight: 700;
    margin-bottom: 10px;
}

.section-intro {
    max-width: 640px;
    margin: 0 auto 40px;
    text-align: center;
    color: var(--ink-soft);
}

/* ---- Life story ------------------------------------------------------- */

.life-story {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.08rem;
}

.life-story p { margin-bottom: 1.3em; }

/* ---- Gallery ------------------------------------------------------------ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sea-light);
    box-shadow: var(--shadow-soft);
}

.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--navy);
    background: repeating-linear-gradient(
        135deg, var(--sea-light), var(--sea-light) 10px, #bcd6e1 10px, #bcd6e1 20px
    );
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

.gallery-placeholder svg { width: 34px; height: 34px; opacity: 0.55; }

.gallery-empty-note {
    text-align: center;
    color: var(--ink-soft);
    font-style: italic;
    margin-top: 18px;
}

/* ---- Memory cards -------------------------------------------------------- */

.memories-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.memory-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    border-top: 4px solid var(--rope);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memory-card img {
    border-radius: 8px;
    margin-bottom: 4px;
}

.memory-card .memory-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--navy-deep);
    font-weight: 600;
}

.memory-card .memory-date {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.memory-card .memory-message {
    color: var(--ink);
    white-space: pre-wrap;
}

.empty-state {
    text-align: center;
    color: var(--ink-soft);
    padding: 40px 20px;
    font-style: italic;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
}

/* ---- Forms ------------------------------------------------------------------ */

.form-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 32px;
    max-width: 620px;
    margin: 0 auto;
}

.form-group { margin-bottom: 20px; }

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--navy-deep);
    font-size: 0.92rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
input[type="file"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cfd8dc;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--foam);
    color: var(--ink);
}

textarea { min-height: 150px; resize: vertical; }

input:focus, textarea:focus {
    outline: none;
    border-color: var(--sea);
    box-shadow: 0 0 0 3px rgba(43, 111, 143, 0.15);
}

.field-hint {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

.field-error {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: 4px;
}

/* Honeypot field — hidden from real visitors, invisible to screen readers */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success { background: #e2f2e8; color: var(--success); border: 1px solid #b9dfc7; }
.alert-error   { background: #fbe9e7; color: var(--danger);  border: 1px solid #f3c3bb; }
.alert-info    { background: #e6eef3; color: var(--navy);    border: 1px solid #c6d8e3; }

/* ---- Footer --------------------------------------------------------------------- */

.site-footer {
    background: var(--navy-deep);
    color: var(--sea-light);
    text-align: center;
    padding: 30px 0 40px;
    font-size: 0.88rem;
}

.site-footer a { color: var(--sand); }

.site-footer .admin-link {
    display: block;
    margin-top: 10px;
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
}

/* ---- Admin --------------------------------------------------------------------------- */

.admin-bar {
    background: var(--ink);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.88rem;
}

.admin-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-bar a { color: var(--sand); }

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    border: 1.5px solid #cfd8dc;
    font-size: 0.9rem;
    font-weight: 600;
}

.tab.is-active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.admin-item {
    border-bottom: 1px solid #e5ebee;
    padding: 20px;
    display: grid;
    gap: 10px;
    background: var(--white);
    margin-bottom: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.admin-item-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.status-pending  { background: #fff3d6; color: #8a6100; }
.status-approved { background: #e2f2e8; color: var(--success); }
.status-rejected { background: #fbe9e7; color: var(--danger); }

.admin-item img { max-width: 240px; border-radius: 8px; margin: 8px 0; }

.admin-item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.login-wrap {
    max-width: 400px;
    margin: 80px auto;
}

@media (max-width: 640px) {
    h1 { font-size: 2.2rem; }
    .hero { padding-top: 40px; }
    .form-card { padding: 22px; }
}
