/* TheClam.com  modernized 1999 beach shack
 * Mobile first. Desktop unlocks the wraparound nav layout on /home.
 */

:root {
    /* Palette */
    --sand-bg:    url('/assets/img/sand-bg.gif');
    --sand-tint:  #e8d5a8;
    --paper:      #fdf6e3;
    --paper-dim:  #f5edd6;
    --ocean:      #2a5d7a;
    --ocean-dk:   #1a3a52;
    --ocean-lt:   #4a7d9a;
    --sun:        #e8a154;
    --sun-dk:     #c97e2e;
    --ink:        #1a1a1a;
    --muted:      #6b7280;
    --rule:       #d4c293;

    --shadow-sm:  0 2px 4px rgba(26, 58, 82, 0.12);
    --shadow-md:  0 4px 12px rgba(26, 58, 82, 0.18);
    --shadow-card-out: 4px 4px 0 rgba(26, 58, 82, 0.15);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ink);
    line-height: 1.55;
    background: var(--sand-tint) var(--sand-bg) repeat;
    min-height: 100vh;
}

a { color: var(--ocean); text-decoration: none; }
a:hover { color: var(--sun-dk); text-decoration: underline; }

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

h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; color: var(--ocean-dk); margin-top: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================================================
   Header
   ======================================================================== */
.site-header {
    background: var(--ocean-dk);
    background-image: linear-gradient(to bottom, var(--ocean) 0%, var(--ocean-dk) 100%);
    color: #fff;
    border-bottom: 4px solid var(--sun);
    box-shadow: var(--shadow-md);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.site-logo-link { display: flex; align-items: center; gap: 0.75rem; }
.site-logo-link:hover { text-decoration: none; }
.site-logo-img {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}
.site-logo-text { color: #fff; line-height: 1.1; }
.site-logo-text strong { font-size: 1.25rem; display: block; letter-spacing: 0.02em; }
.site-logo-text small  { color: var(--paper-dim); font-size: 0.8rem; }

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 3px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.site-nav a:hover { background: var(--sun); color: var(--ocean-dk); text-decoration: none; }
.site-nav a.active { background: rgba(255,255,255,0.15); }

/* ========================================================================
   Main
   ======================================================================== */
.site-main { padding: 1.5rem 0 3rem; }
.page-section { padding: 1rem 0; }

/* Cream content panel */
.panel {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ========================================================================
   Home page
   ======================================================================== */
/* Home page hides the top text nav; the GIF nav row below replaces it. */
body.page-home .site-nav { display: none; }

/* Vertical stack inside .wrap on home: gif-nav, hero, explainer, map. */
.home > .wrap { display: flex; flex-direction: column; gap: 1.25rem; }

.home-map-section { margin-top: 0.75rem; }
.home-map-title  { margin: 0 0 0.5rem; }

/* GIF nav row (home-only). 2 cols mobile, 3 cols small tablet, 6 cols desktop. */
.home-gif-nav {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0.5rem;
}
@media (min-width: 600px) {
    .home-gif-nav { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .home-gif-nav { grid-template-columns: repeat(6, 1fr); gap: 1rem; }
}
.home-gif-nav .nav-card { padding: 0.6rem 0.5rem 0.5rem; }
.home-gif-nav .nav-card-img { height: 70px; margin-bottom: 0.4rem; }
.home-gif-nav .nav-card-img img { max-height: 70px; }
.home-gif-nav .nav-card-label { font-size: 0.9rem; padding-top: 0.3rem; }

/* Hero carousel */
.hero {
    position: relative;
    overflow: hidden;
    border: 3px solid var(--ocean-dk);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 9;
    background: var(--ocean-dk);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    /* site.js toggles .active to drive the carousel. Each slide is shown for
       the exact duration of its video (videos advance on 'ended'), or for
       data-duration ms for image slides. */
}
.hero-slide.active { opacity: 1; }
.hero-slide-video { background: #000; }
.hero-slide-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,58,82,0.85) 0%, rgba(26,58,82,0.2) 50%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    color: #fff;
    z-index: 2;
}
.hero-title {
    color: #fff;
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.hero-tagline {
    margin: 0;
    color: var(--paper);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Explainer */
.explainer h2 {
    border-bottom: 2px solid var(--sun);
    padding-bottom: 0.4rem;
    display: inline-block;
}
.explainer p { margin-bottom: 0.8rem; }

/* Nav cards */
.nav-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}
.nav-card {
    display: block;
    background: var(--paper);
    border: 2px solid var(--ocean-dk);
    border-radius: 6px;
    padding: 0.75rem 0.6rem 0.6rem;
    text-align: center;
    color: var(--ocean-dk);
    box-shadow: var(--shadow-card-out);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.nav-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--sun);
    border-color: var(--sun-dk);
    text-decoration: none;
}
.nav-card:active {
    transform: translate(0, 0);
    box-shadow: var(--shadow-card-out);
}
.nav-card-img {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.nav-card-img img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}
.nav-card-label {
    font-weight: bold;
    font-size: 1rem;
    border-top: 1px dashed var(--rule);
    padding-top: 0.4rem;
}

/* Jumping Index */
.jumps-intro { max-width: 820px; margin: 0 auto 1.5rem; }
.jumps-intro h1 {
    border-bottom: 3px solid var(--sun);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.jumps-lede {
    font-size: 1.05rem;
    color: var(--ocean-dk);
    margin: 0;
}

.jumps-list { display: flex; flex-direction: column; gap: 1.25rem; }

.jump {
    background: var(--paper);
    border: 2px solid var(--rule);
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 700px) {
    .jump { grid-template-columns: 280px 1fr; gap: 1.5rem; }
}
@media (min-width: 1000px) {
    .jump { grid-template-columns: 340px 1fr; }
}

.jump-media { display: flex; flex-direction: column; gap: 0.6rem; }
.jump-thumb {
    width: 100%;
    height: auto;
    border: 2px solid var(--ocean-dk);
    border-radius: 4px;
    background: var(--ocean-dk);
    display: block;
}
.jump-thumb-secondary { opacity: 0.95; }
.jump-thumb-empty {
    aspect-ratio: 4 / 3;
    border: 2px dashed var(--rule);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: var(--paper-dim);
    font-style: italic;
    font-size: 0.9rem;
}

.jump-body { min-width: 0; }
.jump-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.jump-header h2 { margin: 0; }
.jump-height {
    background: var(--ocean-dk);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-family: -apple-system, sans-serif;
    letter-spacing: 0.02em;
}

.jump-tags {
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.jump-tags li {
    background: var(--sun);
    color: var(--ocean-dk);
    font-size: 0.8rem;
    font-family: -apple-system, sans-serif;
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.02em;
}

.jump-text { margin: 0 0 0.75rem; }

.jump-video {
    margin-top: 0.75rem;
    border: 2px solid var(--ocean-dk);
    border-radius: 4px;
    overflow: hidden;
    background: #000;
}
.jump-video video { width: 100%; height: auto; display: block; }

.jumps-photos-stub {
    max-width: 820px;
    margin: 2rem auto 0;
    text-align: center;
    color: var(--muted);
}
.jumps-photos-stub h2 { margin-bottom: 0.5rem; }

/* About page */
.about-panel { max-width: 820px; margin: 0 auto; padding: 2rem 2.25rem; }
.about-panel h1 {
    border-bottom: 3px solid var(--sun);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}
.about-panel h2 {
    margin-top: 2rem;
    border-bottom: 1px dashed var(--rule);
    padding-bottom: 0.3rem;
}
.about-panel p { margin: 0 0 1rem; }
.about-lede {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ocean-dk);
    border-left: 4px solid var(--sun);
    padding: 0.25rem 0 0.25rem 1rem;
    margin-bottom: 1.5rem;
}
.about-panel h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--ocean-dk);
    font-size: 1.15rem;
}
.about-panel .rules-quote {
    background: var(--paper-dim);
    border-left: 4px solid var(--ocean);
    padding: 1rem 1.25rem 0.5rem;
    margin: 0 0 1rem;
    border-radius: 0 4px 4px 0;
}
.about-panel .rules-quote p { margin: 0 0 0.75rem; }
.about-panel .rules-quote ol {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}
.about-panel .rules-quote ol li { margin-bottom: 0.5rem; }
.about-panel .rules-attrib {
    text-align: right;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.25rem 0 0.5rem;
}
.about-panel .rules-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}
.about-panel .rules-list li { margin-bottom: 0.6rem; }

/* Videos page */
.videos-intro {
    max-width: 820px;
    margin: 0 auto 1.25rem;
    padding: 1.5rem 2rem;
}
.videos-intro h1 {
    border-bottom: 3px solid var(--sun);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.video-block {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    padding: 1.25rem 1.5rem 1.5rem;
}
.video-header { margin-bottom: 0.75rem; }
.video-header h2 {
    margin: 0 0 0.25rem;
    border-bottom: 1px dashed var(--rule);
    padding-bottom: 0.3rem;
}
.video-meta {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
}
.video-frame {
    border: 3px solid var(--ocean-dk);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
    aspect-ratio: 4 / 3;
    margin-bottom: 0.75rem;
}
.video-frame video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}
.video-desc {
    margin: 0;
    color: var(--ink);
}

/* Map embed */
.map-embed {
    border: 3px solid var(--ocean-dk);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 9;
    background: var(--ocean-lt);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ========================================================================
   Footer
   ======================================================================== */
.site-footer {
    background: var(--ocean-dk);
    color: var(--paper);
    padding: 2rem 0;
    text-align: center;
    border-top: 4px solid var(--sun);
    margin-top: 2rem;
}
.site-footer .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.site-footer img { max-height: 60px; }
.site-footer p { margin: 0.25rem 0; }
.footer-meta { color: var(--rule); font-size: 0.85rem; }
.site-footer a { color: var(--sun); }

/* ========================================================================
   Forms
   ======================================================================== */
form p { margin: 1rem 0; }
input[type=text], input[type=email], input[type=password], textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}
input:focus, textarea:focus {
    outline: 2px solid var(--sun);
    outline-offset: 1px;
    border-color: var(--ocean);
}
button {
    background: var(--ocean-dk);
    color: #fff;
    border: 2px solid var(--ocean-dk);
    padding: 0.55rem 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}
button:hover { background: var(--sun); border-color: var(--sun-dk); color: var(--ocean-dk); }
button:active { transform: translateY(1px); }

.error { color: #b00020; }

/* ========================================================================
   Alerts
   ======================================================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #66bb6a; }
.alert-error   { background: #fdecea; color: #b71c1c; border: 1px solid #e57373; }
.alert ul { margin: 0.5rem 0 0 1.25rem; }

/* ========================================================================
   Guest Book
   ======================================================================== */
.gb-form .req { color: #b00020; }
.gb-form textarea { resize: vertical; }
.gb-divider { margin: 2.5rem 0 1rem; border: 0; border-top: 1px solid var(--rule); }
.gb-entries-heading { margin: 2rem 0 1rem; }

.gb-entries { list-style: none; padding: 0; margin: 0; }
.gb-entry {
    border: 2px solid var(--rule);
    background: var(--paper);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.gb-entry.is-legacy {
    background: var(--paper-dim);
    border-style: dashed;
}
.gb-entry-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--rule);
    padding-bottom: 0.5rem;
}
.gb-name    { color: var(--ocean-dk); font-size: 1.1rem; }
.gb-country { color: var(--muted); font-size: 0.9rem; }
.gb-date    { color: var(--muted); font-size: 0.9rem; margin-left: auto; }
.gb-message { white-space: pre-wrap; }
.gb-url     { margin-top: 0.5rem; color: var(--muted); }

/* ========================================================================
   Pagination
   ======================================================================== */
.pagination {
    margin: 2rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* ========================================================================
   Admin
   ======================================================================== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}
.admin-tabs a {
    padding: 0.4rem 0.8rem;
    border-radius: 4px 4px 0 0;
    background: var(--paper-dim);
    color: var(--ink);
    border: 1px solid var(--rule);
}
.admin-tabs a.active { background: var(--ocean-dk); color: #fff; border-color: var(--ocean-dk); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-family: -apple-system, sans-serif;
    background: var(--paper);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table th, .admin-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
    text-align: left;
}
.admin-table thead th {
    background: var(--ocean-dk);
    color: #fff;
    border-bottom: none;
}
.admin-table tbody tr:hover { background: var(--paper-dim); }
.admin-table .msg-cell { max-width: 350px; word-break: break-word; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions button {
    padding: 0.3rem 0.6rem;
    margin-right: 0.25rem;
    font-size: 0.85rem;
}
.btn-delete { background: #b71c1c; border-color: #8e0000; }
.btn-delete:hover { background: #8e0000; color: #fff; border-color: #8e0000; }

.flag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin-right: 0.25rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
}
.flag-legacy { background: #8b6f3a; }
.flag-hidden { background: #6b7280; }
.flag-spam   { background: #b71c1c; }

/* ========================================================================
   News page (reuses .video-block, adds station logo header)
   ======================================================================== */
.news-intro {
    max-width: 820px;
    margin: 0 auto 1.25rem;
    padding: 1.5rem 2rem;
}
.news-intro h1 {
    border-bottom: 3px solid var(--sun);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.news-block .news-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed var(--rule);
    padding-bottom: 0.5rem;
}
.news-block .news-header h2 {
    margin: 0 0 0.15rem;
    border-bottom: 0;
    padding-bottom: 0;
}
.news-station-logo {
    height: 56px;
    width: auto;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: var(--shadow-sm);
}
.news-headings { min-width: 0; }
@media (max-width: 480px) {
    .news-block .news-header { flex-wrap: wrap; }
    .news-station-logo { height: 44px; }
}

/* ========================================================================
   Photos page (responsive grid + jQuery lightbox)
   ======================================================================== */
.photos-intro { max-width: 820px; margin: 0 auto 1.25rem; }
.photos-intro h1 { margin-bottom: 0.5rem; }
.photos-lede { color: var(--muted); margin: 0; }
.photos-empty code {
    background: var(--paper-dim);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.photo-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px)  { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }

.photo-card {
    display: block;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 6px;
    box-shadow: var(--shadow-card-out);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(26, 58, 82, 0.2);
    text-decoration: none;
}
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* Lightbox overlay */
body.lightbox-open { overflow: hidden; }
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    border: 4px solid var(--paper);
    border-radius: 2px;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 0.5rem; right: 0.5rem; font-size: 3rem; }
.lightbox-prev  { left: 0.5rem;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--paper-dim);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.4);
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
}

/* ========================================================================
   Mobile tweaks
   ======================================================================== */
@media (max-width: 640px) {
    .site-header .wrap { flex-direction: column; align-items: flex-start; }
    .hero-title { font-size: 1.25rem; }
    .admin-table { font-size: 0.8rem; }
    .admin-table .msg-cell { max-width: 200px; }
    .lightbox-close { font-size: 2.25rem; }
    .lightbox-prev, .lightbox-next { font-size: 2rem; padding: 0.25rem 0.5rem; }
}
