/* ==========================================================================
   Alpha at St. Peter — Custom Styles
   Tailwind utility classes handle most styling; this file holds the
   custom bits Tailwind can't express inline.
   ========================================================================== */

/* Smooth scrolling for in-page anchor links */
html {
    scroll-behavior: smooth;
}

/* Custom grain overlay — a subtle film of noise across the whole viewport */
.bg-grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.12%22/%3E%3C/svg%3E');
    opacity: 0.4;
}

/* Typography tweaks */
h1, h2, h3 {
    letter-spacing: -0.02em;
}

/* Lift + shadow on primary buttons */
.btn-hover-effect {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Responsive 16:9 video container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Scroll-reveal animation (toggled by js/main.js) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger the When / Where / What cards so they cascade in gently on wider
   screens (where all three share a row) instead of popping in together. On
   mobile they're stacked and reveal one-by-one as you scroll, so no delay. */
@media (min-width: 768px) {
    #details .grid > .reveal:nth-child(2) { transition-delay: 0.12s; }
    #details .grid > .reveal:nth-child(3) { transition-delay: 0.24s; }
}

/* Respect users who prefer reduced motion: show content with no slide/fade. */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Collapsible schedule (<details>)
   ========================================================================== */
.schedule-details {
    text-align: center;
}
.schedule-summary {
    list-style: none;
    cursor: pointer;
}
.schedule-summary::-webkit-details-marker {
    display: none;
}
/* Explicitly hide the contents while collapsed (don't rely on UA <details> rendering) */
.schedule-details:not([open]) .schedule-body,
.schedule-details:not([open]) > p {
    display: none;
}
.schedule-summary .label-open {
    display: none;
}
.schedule-details[open] .schedule-summary .label-closed {
    display: none;
}
.schedule-details[open] .schedule-summary .label-open {
    display: inline;
}
.schedule-summary .caret {
    transition: transform 0.25s ease;
}
.schedule-details[open] .schedule-summary .caret {
    transform: rotate(180deg);
}
/* The body keeps the section's normal (left) text alignment once revealed */
.schedule-body,
.schedule-details > p {
    text-align: initial;
}

/* ==========================================================================
   Collapsible FAQ (<details>) — whole section hidden until opened, then each
   question is its own accordion item.
   ========================================================================== */
.faq-details {
    text-align: center;
}
.faq-summary {
    list-style: none;
    cursor: pointer;
    max-width: 100%;
}
.faq-summary::-webkit-details-marker {
    display: none;
}
.faq-summary .caret {
    transition: transform 0.25s ease;
}
.faq-details[open] .faq-summary .caret {
    transform: rotate(180deg);
}
.faq-details:not([open]) .faq-body {
    display: none;
}
.faq-body {
    text-align: initial;
}

.faq-q {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    transition: background-color 0.15s ease;
}
.faq-q::-webkit-details-marker {
    display: none;
}
.faq-q:hover {
    background: #faf7f7;
}
.faq-q .faq-icon {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: #E42312;
    transition: transform 0.25s ease;
}
.faq-item[open] .faq-q .faq-icon {
    transform: rotate(45deg); /* plus → ✕ */
}
.faq-a {
    padding: 0 1.25rem 1.25rem;
    color: #4b5563;
    line-height: 1.65;
}
.faq-item:not([open]) .faq-a {
    display: none;
}

/* ==========================================================================
   Modals (sign-up + newsletter)
   ========================================================================== */
body.modal-open {
    overflow: hidden;
}
.modal:not(.hidden) .modal-card {
    animation: modalIn 0.25s ease forwards;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form fields (shared by all forms) */
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    color: #374151;
}
.form-label .req {
    color: #E42312;
}
.form-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input::placeholder {
    color: #9ca3af;
}
.form-input:focus {
    outline: none;
    border-color: #E42312;
    box-shadow: 0 0 0 3px rgba(228, 35, 18, 0.15);
}

/* ==========================================================================
   Timed newsletter toast (corner card on desktop, bottom banner on mobile)
   ========================================================================== */
.newsletter-toast {
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.newsletter-toast.show {
    transform: translateY(0);
    opacity: 1;
    /* Bounce onto the screen so it catches the eye */
    animation: toastBounceIn 0.7s ease-out both;
}
@keyframes toastBounceIn {
    0%   { transform: translateY(150%); opacity: 0; }
    55%  { transform: translateY(-14px); opacity: 1; }
    75%  { transform: translateY(8px); }
    90%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .newsletter-toast.show {
        animation: none;
    }
}
