/* ============================================================
   GLOBAL RESET & VARIABLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:    #1e293b;   /* slate-800 */
    --color-accent:     #c0392b;   /* deep red — Food Market brand */
    --color-accent-dk:  #96281b;
    --color-bg:         #f1f5f9;
    --color-surface:    #ffffff;
    --color-border:     #e2e8f0;
    --color-text:       #1e293b;
    --color-muted:      #64748b;
    --color-link:       #2563eb;
    --radius:           10px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:        0 4px 12px rgba(0,0,0,.10);
    --font:             'Inter', system-ui, sans-serif;
    --header-h:         68px;
}

html {
    scroll-behavior: smooth;
    color-scheme: light;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    font-size: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

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

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-main {
    flex: 1;
    padding: 2.5rem 0 4rem;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
.site-header {
    background: #2d3748;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 4px;
}

.logo-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .02em;
    line-height: 1.2;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: #a0aec0;
    font-size: .925rem;
    font-weight: 500;
    padding: .45rem .85rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,.1);
    text-decoration: none;
}

.nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #a0aec0;
    border-radius: 2px;
    transition: transform .2s;
}

/* ============================================================
   PAGE TITLE
   ============================================================ */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
    padding-bottom: .75rem;
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
    padding: 2rem;
    border-top: 4px solid var(--color-accent);
    display: flex;
    flex-direction: column;
}

.contact-card .map-wrapper {
    margin-top: auto;
}

.contact-card .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.contact-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
}

.card-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
}

.contact-info {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-bottom: 1.5rem;
}

.contact-info li {
    display: flex;
    gap: .6rem;
    font-size: .95rem;
    align-items: flex-start;
}

.contact-info .label {
    font-weight: 600;
    color: var(--color-muted);
    min-width: 90px;
    flex-shrink: 0;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-top: .1rem;
}

.contact-info .value {
    color: var(--color-text);
    overflow-wrap: break-word;
    min-width: 0;
}

.contact-info a {
    color: var(--color-link);
    overflow-wrap: break-word;
    word-break: break-all;
}

.map-wrapper {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1.25rem;
    border: 1px solid var(--color-border);
}

.map-wrapper iframe {
    width: 100%;
    height: 380px;
    display: block;
    border: none;
}

/* ============================================================
   ANNOUNCEMENTS PAGE
   ============================================================ */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.announcement-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-accent);
    overflow: hidden;
    transition: box-shadow .15s;
}

.announcement-card:hover {
    box-shadow: var(--shadow-md);
}

.announcement-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.75rem;
    cursor: pointer;
    user-select: none;
}

.announcement-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: .2rem;
}

.announcement-info .ann-meta {
    font-size: .85rem;
    color: var(--color-muted);
}

.ann-chevron {
    color: var(--color-muted);
    transition: transform .25s ease;
    flex-shrink: 0;
}

.announcement-card.expanded .ann-chevron {
    transform: rotate(180deg);
}

.pdf-viewer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}

.announcement-card.expanded .pdf-viewer {
    max-height: 800px;
}

.pdf-viewer iframe {
    width: 100%;
    height: 780px;
    border: none;
    display: block;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--color-accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    padding: .55rem 1.1rem;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}

.btn-download:hover {
    background: var(--color-accent-dk);
    text-decoration: none;
    color: #fff;
}

.btn-download svg { width: 16px; height: 16px; }

.empty-state {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--color-muted);
    font-size: 1rem;
    border: 2px dashed var(--color-border);
}

/* ============================================================
   PHOTOS PAGE
   ============================================================ */
.store-section {
    margin-bottom: 3rem;
}

.store-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.store-section h2::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--color-border);
}

.photo-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.photo-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   LOGIN & UPLOAD PAGES
   ============================================================ */
.auth-wrapper {
    max-width: 420px;
    margin: 0 auto;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.25rem 2.5rem;
}

.card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: var(--color-primary);
}

.upload-wrapper {
    max-width: 640px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .45rem;
    color: var(--color-primary);
}

.form-control {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--color-border);
    border-radius: 7px;
    font-family: var(--font);
    font-size: .975rem;
    color: var(--color-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-control:focus {
    border-color: var(--color-link);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-hint {
    font-size: .82rem;
    color: var(--color-muted);
    margin-top: .35rem;
}

.file-drop {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #f8fafc;
    position: relative;
}

.file-drop:hover,
.file-drop.drag-over {
    border-color: var(--color-link);
    background: #eff6ff;
}

.file-drop.has-file {
    border-color: var(--color-accent);
    background: #fff5f5;
    border-style: solid;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-drop-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem;
    display: block;
}

.file-drop p {
    color: var(--color-muted);
    font-size: .925rem;
}

.file-drop strong {
    color: var(--color-link);
}

#file-name-display {
    margin-top: .5rem;
    font-size: .875rem;
    color: var(--color-primary);
    font-weight: 500;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    padding: .75rem 1.75rem;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
    margin-top: .5rem;
}

.btn-primary:hover { background: var(--color-accent-dk); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    color: var(--color-muted);
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 7px;
    cursor: pointer;
    font-family: var(--font);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.btn-secondary:hover {
    border-color: var(--color-muted);
    color: var(--color-text);
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: .9rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .95rem;
    font-weight: 500;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Upload page extra */
.upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.upload-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.uploaded-list {
    margin-top: 2.5rem;
}

.uploaded-list h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: .5rem;
}

.uploaded-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-radius: 8px;
    background: var(--color-bg);
    margin-bottom: .6rem;
    font-size: .9rem;
}

.uploaded-item .item-title { font-weight: 600; }
.uploaded-item .item-date  { color: var(--color-muted); font-size: .82rem; }

.btn-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    padding: .3rem .6rem;
    border-radius: 5px;
    transition: background .15s;
}

.btn-delete:hover { background: #fee2e2; }

/* ============================================================
   PAGE HEADER (title + upload button row)
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header .page-title {
    margin-bottom: 0;
}

.btn-upload-open {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 600;
    padding: .6rem 1.25rem;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.btn-upload-open:hover { background: var(--color-accent-dk); }

.admin-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.btn-logout {
    font-size: .8rem;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: .3rem .75rem;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.btn-logout:hover { color: var(--color-accent); border-color: var(--color-accent); text-decoration: none; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0 .25rem;
    transition: color .15s;
}

.modal-close:hover { color: var(--color-text); }

/* ============================================================
   ANNOUNCEMENT ACTIONS (download + delete side by side)
   ============================================================ */
.ann-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-primary);
    color: #94a3b8;
    padding: 1.25rem 0;
    font-size: .875rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
    max-width: 420px;
    margin: 3rem auto;
}

.login-form {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-top: 1.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        background: #2d3748;
        flex-direction: column;
        padding: 1rem;
        gap: .25rem;
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
    }

    .site-nav.open { display: flex; }

    .site-header { position: relative; }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .logo-text {
        display: none;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .announcement-card {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Icon-only download button on mobile */
    .btn-download span { display: none; }
    .btn-download { padding: .55rem .75rem; }

    .card { padding: 1.75rem 1.5rem; }

    .upload-header { flex-direction: column; align-items: flex-start; }

    /* Modal full-width on mobile */
    .modal { padding: 1.25rem; border-radius: 0; max-height: 100vh; }
    .modal-backdrop { padding: 0; align-items: flex-end; }
}

