/*  
   GRILLAPE — POLISH & ACCESSIBILITY
   Focus management, motion preferences, print, WP helpers, utilities. */

/* 
   FOCUS STYLES — visible keyboard focus for all interactive elements */
:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 3px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure focus is visible inside the mobile nav panel on dark background */
.mobile-nav__panel :focus-visible {
    outline-color: var(--color-yellow);
}

/*   REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .watermark {
        transform: none !important;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: more) {
    .btn--outline-white {
        border-width: 3px;
    }
    .btn--outline-green {
        border-width: 3px;
    }
    /* Watermark degrades contrast in high-contrast mode — remove it */
    .watermark {
        display: none;
    }
    /* Ensure section separators are visible */
    .site-footer__bottom {
        border-top-color: currentColor;
    }
}

/* ------------------------------------------------------------------
   PRINT
------------------------------------------------------------------ */
@media print {
    .site-header,
    .mobile-nav,
    .watermark,
    .swiper-button-prev,
    .swiper-button-next,
    .hero__ctas,
    .section__cta-row,
    .about-cta,
    .social-links,
    .site-footer__bottom,
    .pagination {
        display: none !important;
    }

    .site-main {
        margin-top: 0 !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .section--green {
        background: #fff !important;
        color: #000 !important;
    }

    .section--cream {
        background: #fff !important;
        color: #000 !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        word-break: break-all;
    }

    /* Don't expand internal anchor links or javascript: */
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    h1, h2, h3 { page-break-after: avoid; }
    img         { max-width: 100%; page-break-inside: avoid; }
}

/* ------------------------------------------------------------------
   SWIPER CUSTOM BUTTON STYLES — dark pill arrows matching brand
------------------------------------------------------------------ */
.swiper-button-prev,
.swiper-button-next {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-pill);
    width: 3rem;
    height: 3rem;
    color: var(--color-off-white);
    margin-top: calc(-1 * 3rem / 2);
    transition: background-color var(--t-fast);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background-color: rgba(0, 0, 0, 0.65);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 1rem;
    font-weight: 900;
}

.swiper-button-prev:focus-visible,
.swiper-button-next:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 3px;
}

/* ------------------------------------------------------------------
   SMOOTH IMAGE LOADING
------------------------------------------------------------------ */
img {
    transition: opacity 0.3s ease;
}

/* ------------------------------------------------------------------
   WORDPRESS ADMIN BAR OFFSET (when editor is logged in)
------------------------------------------------------------------ */
@media screen {
    .admin-bar .site-header {
        top: 32px;
    }
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* ------------------------------------------------------------------
   WORDPRESS ALIGNMENT CLASSES
------------------------------------------------------------------ */
.alignleft {
    float: left;
    margin: 0 var(--sp-6) var(--sp-4) 0;
}

.alignright {
    float: right;
    margin: 0 0 var(--sp-4) var(--sp-6);
}

.aligncenter {
    display: block;
    margin: 0 auto var(--sp-4);
}

.alignwide {
    margin-inline: calc(-1 * var(--container-pad));
    max-width: calc(100% + (2 * var(--container-pad)));
    width: calc(100% + (2 * var(--container-pad)));
}

.alignfull {
    margin-inline: calc(-1 * var(--container-pad));
    max-width: calc(100% + (2 * var(--container-pad)));
    width: calc(100% + (2 * var(--container-pad)));
}

.wp-caption {
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.7;
    margin-bottom: var(--sp-4);
}

.wp-caption img {
    display: block;
    margin-bottom: var(--sp-2);
}

/* ------------------------------------------------------------------
   SCREEN READER ONLY UTILITY
------------------------------------------------------------------ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focusable variant — revealed on focus (e.g. skip links) */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--sp-2) var(--sp-4);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ------------------------------------------------------------------
   SKIP LINK (declared in header.php, styled here)
------------------------------------------------------------------ */
.skip-link {
    position: absolute;
    top: -9999px;
    left: var(--sp-4);
    z-index: 999;
    background-color: var(--color-yellow);
    color: var(--color-green);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--sp-3) var(--sp-6);
    border-radius: var(--radius-pill);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--sp-4);
}

/* ------------------------------------------------------------------
   SMOOTH PAGE LOAD — prevent flash of unstyled content
------------------------------------------------------------------ */
body {
    opacity: 1;
    transition: opacity 0.15s ease;
}

/* ------------------------------------------------------------------
   FIND US CARD (supplements Bucket 2 styles)
------------------------------------------------------------------ */
.find-us-card {
    background-color: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: var(--radius-card);
    padding: var(--sp-8) var(--sp-10);
    text-align: center;
    color: var(--color-off-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    max-width: 28rem;
    width: 100%;
}

.find-us-card__status {
    display: inline-block;
    padding: 0.3em 1em;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status--open    { background-color: var(--color-yellow); color: var(--color-green); }
.status--closed  { background-color: rgba(255, 255, 255, 0.15); color: var(--color-off-white); }
.status--special { background-color: rgba(245, 183, 49, 0.35); color: var(--color-yellow); }

.find-us-card__location { margin: 0; }
.find-us-card__address,
.find-us-card__hours { opacity: 0.75; }
.find-us-card__note { font-size: 0.875rem; opacity: 0.7; }

/* ------------------------------------------------------------------
   EVENT CARD (supplements Bucket 4 styles)
------------------------------------------------------------------ */
.event-card {
    display: flex;
    gap: var(--sp-6);
    align-items: flex-start;
    padding: var(--sp-6) 0;
    border-bottom: 1px solid rgba(26, 92, 58, 0.1);
}
.event-card:last-child { border-bottom: none; }

.event-card__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.5rem;
    background-color: var(--color-green);
    color: var(--color-off-white);
    border-radius: var(--radius-card);
    padding: var(--sp-2) var(--sp-3);
    flex-shrink: 0;
}

.event-card__day   { line-height: 1; }
.event-card__month { font-size: 0.65rem; opacity: 0.8; }

.event-card__info  { flex: 1; }
.event-card__type  { display: block; margin-bottom: var(--sp-1); color: var(--color-green); opacity: 0.65; }
.event-card__title { margin: 0 0 var(--sp-2); }
.event-card__meta  { opacity: 0.65; }

/* ------------------------------------------------------------------
   INSTAGRAM SECTION SOCIAL HANDLE LINK
------------------------------------------------------------------ */
.section__social-handle {
    display: inline-block;
    margin-top: var(--sp-2);
    color: var(--color-yellow);
    opacity: 0.85;
    transition: opacity var(--t-fast);
}
.section__social-handle:hover { opacity: 1; }

.section--cream .section__social-handle {
    color: var(--color-green);
}

/* ------------------------------------------------------------------
   MISCELLANEOUS GAP FILLS
------------------------------------------------------------------ */

/* Clearfix for floated alignleft/alignright images in prose */
.prose::after {
    content: "";
    display: table;
    clear: both;
}

/* Remove tap highlight colour on mobile for buttons and links */
a,
button {
    -webkit-tap-highlight-color: transparent;
}

/* Improve legibility of small eyebrow text on subpixel rendering */
.eyebrow {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent long strings breaking layout in post cards and prose */
.post-card__title,
.post-card__excerpt,
.prose {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ------------------------------------------------------------------
   FLEXIBLE PAGE SECTIONS (page-flexible.php)
------------------------------------------------------------------ */
@media (min-width: 48rem) {
    .flexible-section__inner--split {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-12);
        align-items: center;
    }
}

.flexible-section__cta { margin-top: var(--sp-6); }

.flexible-section__media img {
    border-radius: var(--radius-card);
    width: 100%;
    display: block;
}
