/*
Theme Name: RAOB Club Carlisle
Description: Traditional British pub-inspired theme styles for RAOB Club Carlisle.
Author: RAOB Club Carlisle
Version: 0.1.0
*/

/*
  DESIGN INTENT
  - Warm wood tones, bottle green upholstery, brass accents, deep burgundy, cream.
  - Readable serif headings with classic feel; clean sans for body copy.
  - Subtle textures via gradients; easy swap-in for photo textures if desired.
*/

/* =========================
   CSS VARIABLES
   ========================= */
:root {
    /* Core palette */
    --wood-900: #5a3c1e; /* dark walnut */
    --wood-700: #7a522b; /* bar front */
    --wood-500: #a87845; /* honey oak */
    --green-900: #0f412f; /* bottle green (seating) */
    --green-700: #165c42; /* billiards rail */
    --green-500: #1f7a57; /* accents */
    --baize-600: #1a7c4b; /* snooker table felt */
    --burgundy-700: #6f1d1b; /* club red */
    --gold-500: #c8a75d; /* brass / plaque */
    --gold-600: #b89246;
    --cream-50: #faf6ee; /* paper/cream */
    --cream-200: #efe6d8;
    --ink-900: #1a1a1a; /* text */
    --ink-700: #333;

    /* Typographic scale */
    --font-display: 'Graduate', ui-serif, Georgia, 'Times New Roman', Times,
        serif;
    --font-serif: var(--font-display);
    --font-sans: 'Graduate', system-ui, -apple-system, Segoe UI, Roboto,
        Helvetica, Arial, sans-serif;
    --fs-900: clamp(2rem, 4vw, 3rem);
    --fs-800: clamp(1.75rem, 3vw, 2.25rem);
    --fs-700: 1.5rem;
    --fs-600: 1.25rem;
    --fs-500: 1.125rem;
    --fs-400: 1rem;

    /* Layout */
    --content-max: 1200px;
    --gutter: 1rem;
    --radius: 8px;
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.18);
    --focus: 0 0 0 3px rgba(200, 167, 93, 0.45);
    --transition: 180ms ease-out;
}

/* =========================
   BASE / RESETS
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-400);
    line-height: 1.6;
    color: var(--ink-900);
    background: linear-gradient(180deg, var(--cream-50), #fff);
}

img,
video {
    max-width: 100%;
    height: auto;
}
figure {
    margin: 0;
}

a {
    color: var(--green-700);
    text-decoration-color: color-mix(
        in oklab,
        var(--green-700),
        transparent 60%
    );
}
a:hover {
    color: var(--green-500);
    text-decoration-color: var(--green-500);
}
button,
[type='button'],
[type='submit'] {
    font: inherit;
}

.container {
    width: min(100% - 2 * var(--gutter), var(--content-max));
    margin-inline: auto;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    background: var(--gold-500);
    color: #222;
    border-radius: var(--radius);
}

/* =========================
   TYPOGRAPHY
   ========================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: var(--wood-900);
    letter-spacing: 0.3px;
}
h1 {
    font-size: var(--fs-900);
}
h2 {
    font-size: var(--fs-800);
}
h3 {
    font-size: var(--fs-700);
}
h4 {
    font-size: var(--fs-600);
}
p {
    margin: 0 0 1em;
}

/* Remove underlines from page/post titles */
.entry-title a,
.wp-block-post-title a,
.page-title a,
h1 a {
    text-decoration: none;
}
.entry-title a:hover,
.entry-title a:focus-visible,
.wp-block-post-title a:hover,
.wp-block-post-title a:focus-visible,
.page-title a:hover,
.page-title a:focus-visible,
h1 a:hover,
h1 a:focus-visible {
    text-decoration: none;
}

/* Small caps helper for pub signage vibe */
.small-caps {
    font-variant-caps: small-caps;
    letter-spacing: 0.02em;
}

/* Oswald font utility for selective usage */
.font-oswald {
    font-family: 'Oswald', system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
        Arial, sans-serif;
    font-weight: 300;
}

/* Editor block style: apply Oswald when style is toggled */
.is-style-oswald {
    font-family: 'Oswald', system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
        Arial, sans-serif;
    font-weight: 300;
}

/* Editor block style: No Section Padding
   If any inner block has this style, drop the outer .section padding */
.container.section:has(.is-style-no-section-padding),
.section:has(.is-style-no-section-padding) {
    padding: 0 !important;
}

/* Utility class: no-section-padding
   - Add this class to any inner block to drop the parent .section padding
   - Or add directly to the .section/.container.section wrapper */
.container.section:has(.no-section-padding),
.section:has(.no-section-padding),
.container.section.no-section-padding,
.section.no-section-padding {
    padding: 0 !important;
}

/* =========================
   HEADER / NAVIGATION
   ========================= */
.site-header {
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent),
        linear-gradient(90deg, var(--wood-900), var(--wood-700));
    border-bottom: 6px solid var(--gold-600);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06), var(--shadow-soft);
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.site-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
    letter-spacing: 0.5px;
}
.site-tagline {
    color: #f6ead6;
    font-size: 0.9rem;
}

.site-nav {
    margin-left: auto;
}
.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}
.menu a {
    display: block;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.3px;
}
/* Higher-contrast menu hover/active states against dark header */
.menu a:hover {
    background: color-mix(in oklab, var(--gold-500), transparent 80%);
}
.menu .current-menu-item > a {
    background: color-mix(in oklab, var(--gold-500), transparent 70%);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
    line-height: 1;
}
.nav-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

/* Mobile nav */
@media (max-width: 760px) {
    .site-header .container {
        flex-wrap: wrap;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }
    .site-nav {
        width: 100%;
        display: none;
    }
    .site-nav.open {
        display: block;
    }
    .menu {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* =========================
   HERO
   ========================= */
.pub-hero {
    position: relative;
    color: #fff;
    text-align: center;
    background: radial-gradient(
            1200px 300px at 50% 0%,
            rgba(0, 0, 0, 0.45),
            transparent 70%
        ),
        linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.65));
    /* Add pub photo as inline style or override via .pub-hero::before with background-image */
}
.pub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-image: var(--hero-image);
    filter: saturate(0.95) contrast(1.05);
}
.pub-hero .container {
    padding: clamp(3rem, 8vw, 6rem) 0;
}
.pub-hero h1 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.pub-hero p {
    color: #f5efe2;
    font-size: var(--fs-500);
    max-width: 60ch;
    margin-inline: auto;
}

/* =========================
   BUTTONS
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition),
        background var(--transition);
}
.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}
.btn--primary {
    color: #1f1a10;
    background: linear-gradient(180deg, var(--gold-500), var(--gold-600));
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--primary:hover {
    transform: translateY(-1px);
}
.btn--ghost {
    border: 2px solid var(--gold-500);
    color: #fff;
}

/* =========================
   SECTIONS
   ========================= */
.section {
    padding: clamp(2rem, 6vw, 4rem) 0;
    background: #fff;
}
.section--alt {
    background: linear-gradient(180deg, var(--cream-50), var(--cream-200));
}

/* Reduce gap between hero and content on default pages */
.page .pub-hero + .container.section {
    padding-top: 0;
    margin-top: 10px;
}

/* Default Page Template background (exclude Club Home) */
/* Ensure full page uses the cream background, and content area is transparent */
body.page:not(.page-template-template-home) {
    background: #fdfbf7;
}
body.page:not(.page-template-template-home) .container.section {
    background: transparent;
}

.section-title {
    display: inline-block;
    padding-bottom: 0.25rem;
    border-bottom: 4px double var(--gold-500);
    margin-bottom: 1rem;
}

/* Facilities grid (pub / billiards / lodge) */
.facility-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid color-mix(in oklab, var(--wood-500), transparent 70%);
}
.card__media {
    aspect-ratio: 16 / 9;
    background: #ddd;
}
.card__body {
    padding: 1rem;
}
.card h3 {
    margin: 0 0 0.4rem;
}

/* Block style: Card Link
   - Apply to a Group block that also uses the .card class (or place inside a .card)
   - Makes the card look clickable, with pop and shine on hover */
.card.is-style-card-link,
.is-style-card-link.card,
.card:has(.is-style-card-link) {
    cursor: pointer;
    position: relative;
}

.card.is-style-card-link:hover,
.card:has(.is-style-card-link):hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    transition: transform var(--transition), box-shadow var(--transition);
}

/* Shine sweep */
.card.is-style-card-link::after,
.card:has(.is-style-card-link)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 35%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 65%
    );
    transform: translateX(-120%);
    pointer-events: none;
}

.card.is-style-card-link:hover::after,
.card:has(.is-style-card-link):hover::after {
    transform: translateX(120%);
    transition: transform 600ms ease;
}

/* Event list / notice board (bingo & concerts) */
.notice-board {
    background: linear-gradient(160deg, #0f2a1f, #112e22);
    color: #f5f5f5;
    border-radius: var(--radius);
    border: 2px solid #0a2219;
    box-shadow: inset 0 0 0 2px rgba(200, 167, 93, 0.15), var(--shadow-card);
    padding: 1.25rem;
}
.notice-board .heading {
    font-family: var(--font-display);
    font-size: var(--fs-700);
    color: #f7e7c7;
}
.event-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}
.event-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1rem;
    align-items: baseline;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}
.event-date {
    font-weight: 800;
    color: #d5c28f;
}
.event-title {
    font-weight: 700;
}
.event-meta {
    color: #e6e0d5;
    font-size: 0.95rem;
    display: block; /* allow width for ellipsis */
    white-space: nowrap; /* single line */
    overflow: hidden; /* hide overflow */
    text-overflow: ellipsis; /* end with … */
}

/* Linked event rows */
.event-list li.event {
    padding: 0;
    border: none;
    display: block;
}
.event-list a.event-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1rem;
    align-items: baseline;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    color: inherit;
    text-decoration: none;
}
.event-list a.event-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Billiards highlight */
.billiards {
    background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--baize-600), #000 8%),
        var(--baize-600)
    );
    color: #fff;
}
.billiards .card {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Lodge room accents */
.lodge {
    background-color: #fdfbf7
}
.lodge .section-title {
    color: var(--burgundy-700);
    border-bottom-color: var(--burgundy-700);
}

/* =========================
   GUTENBERG DEFAULTS
   ========================= */
.wp-block-image figcaption,
.wp-caption .wp-caption-text {
    color: var(--ink-700);
    font-size: 0.95rem;
}
.alignwide {
    width: min(100% - var(--gutter), 1400px);
    margin-inline: auto;
}
.alignfull {
    width: 100%;
}
.wp-block-gallery {
    --gallery-gap: 0.5rem;
    gap: var(--gallery-gap);
}

/* =========================
   TABLES (snooker results etc.)
   ========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
th,
td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #ece7de;
    text-align: left;
}
th {
    background: linear-gradient(180deg, var(--cream-200), #fff);
    color: var(--wood-900);
}
tbody tr:hover {
    background: #faf7f1;
}

/* =========================
   FORMS (membership / bookings)
   ========================= */
input,
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 6px;
    border: 1px solid #d9cdbb;
    background: #fff;
    color: var(--ink-900);
}
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: var(--focus);
    border-color: var(--gold-500);
}
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

/* ========================= 
   FOOTER
   ========================= */
.site-footer {
    color: #f5efe2;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5)),
        linear-gradient(90deg, var(--wood-900), var(--wood-700));
    border-top: 6px solid var(--gold-600);
}
.site-footer .container {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 2rem 0;
}
.site-footer a {
    color: #fff;
}
.site-footer small {
    display: block;
    opacity: 0.85;
}
/* Improve footer heading contrast */
.site-footer h3,
.site-footer .section-title {
    color: var(--gold-500);
}
/* Footer address semantics */
.site-footer address {
    font-style: normal;
    margin: 0;
}
.site-footer .address-map-link {
    display: inline-block;
    margin-top: 0.25rem;
}

/* =========================
   UTILITIES & HELPERS
   ========================= */
.wood-bg {
    background: linear-gradient(180deg, var(--wood-700), var(--wood-900));
    color: #fff;
}
.green-bg {
    background: var(--green-900);
    color: #f4fbf7;
}
.cream-bg {
    background: var(--cream-50);
}
.brass-text {
    color: var(--gold-500);
}
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* =========================
   ACCESSIBILITY STATES
   ========================= */
:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}
.menu a:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

/* =========================
   OPTIONAL TEXTURES (swap-in assets)
   ========================= */
/*
  To add real-world textures without editing markup, drop files into
  assets/ and uncomment the rules below.

  Example files:
  - assets/wood.jpg (bar/wood panel)
  - assets/baize.jpg (billiards felt)
  - assets/brass.jpg (subtle brass plate)
*/

/* High-contrast gradient header (replaces wood texture) */
.site-header {
    background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.25),
            rgba(0, 0, 0, 0.45)
        ),
        linear-gradient(90deg, var(--green-900), var(--green-700));
}
/* .pub-hero::before { background-image: url('assets/bar.jpg'); } */
.billiards {
    background-image: url('assets/baize.png');
    background-size: cover;
    background-blend-mode: multiply;
}

/* =========================
   RESPONSIVE TWEAKS
   ========================= */
@media (max-width: 980px) {
    :root {
        --fs-900: clamp(1.75rem, 6vw, 2.5rem);
    }
}
@media (max-width: 760px) {
    .site-footer .container {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .site-title {
        font-size: 1.25rem;
    }
    .site-footer .container {
        grid-template-columns: 1fr;
    }
    /* Notice board: stack rows and allow wrapping on small screens */
    .event-list li,
    .event-list a.event-item {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        align-items: start;
    }
    /* Make the date a compact badge and keep it visible first */
    .event-date {
        display: inline-block;
        padding: 0.125rem 0.5rem;
        border: 1px solid rgba(213, 194, 143, 0.35);
        border-radius: 999px;
        font-size: 0.875rem;
        line-height: 1.1;
        background: rgba(0, 0, 0, 0.15);
    }
    /* Let meta wrap to multiple lines on phones */
    .event-meta {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}
