/* Sandy Flower Club - Custom Styles */
/* Built on top of Bulma CSS */

/* ==========================================================================
   CSS Variables - Natural Color Palette
   ========================================================================== */

:root {
    /* Primary - Natural green */
    --primary: #5a8f5c;
    --primary-light: #7ab87c;
    --primary-dark: #3d6b3f;
    
    /* Neutrals - Warm tones */
    --background: #faf9f7;
    --surface: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    
    /* Accents */
    --accent: #d4a574;
    --accent-light: #e8c9a8;
    
    /* Semantic */
    --success: #5a8f5c;
    --warning: #f0ad4e;
    --danger: #c0392b;
    --info: #3273dc;
}

/* ==========================================================================
   Global Styles
   ========================================================================== */

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================================================
   Bulma Overrides
   ========================================================================== */

/* Primary color */
.has-background-primary,
.hero.is-primary {
    background-color: var(--primary) !important;
}

.has-text-primary {
    color: var(--primary) !important;
}

.button.is-primary {
    background-color: var(--primary);
    border-color: transparent;
}

.button.is-primary:hover {
    background-color: var(--primary-dark);
}

.button.is-primary.is-outlined {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.button.is-primary.is-outlined:hover {
    background-color: var(--primary);
    color: white;
}

.tag.is-primary {
    background-color: var(--primary);
}

.tag.is-primary.is-light {
    background-color: rgba(90, 143, 92, 0.15);
    color: var(--primary-dark);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-item:hover {
    color: var(--primary);
}

/* ==========================================================================
   Hero Sections
   ========================================================================== */

.hero.is-primary .title,
.hero.is-primary .subtitle {
    color: white;
}

.hero.is-primary .subtitle {
    opacity: 0.9;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-image img {
    border-radius: 8px 8px 0 0;
    object-fit: cover;
}

.article-card .card-content {
    padding: 1.25rem;
}

.article-card .title a {
    transition: color 0.2s ease;
}

.article-card .title a:hover {
    color: var(--primary) !important;
}

/* Event Card */
.event-card.is-cancelled {
    opacity: 0.7;
}

.event-card.is-cancelled .title a {
    text-decoration: line-through;
}

.date-badge {
    min-width: 70px;
}

/* ==========================================================================
   Content
   ========================================================================== */

.content.article-content {
    line-height: 1.8;
}

.content.article-content h1,
.content.article-content h2,
.content.article-content h3,
.content.article-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content.article-content img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.content.article-content blockquote {
    background-color: #f5f5f5;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

.content.article-content code {
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.content.article-content pre {
    background-color: #2d3436;
    color: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.content.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background-color: #f5f5f5;
    padding: 3rem 1.5rem;
    margin-top: 3rem;
}

.footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--text-light);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Boxes
   ========================================================================== */

.box {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notification {
    border-radius: 8px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.input:focus,
.textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(90, 143, 92, 0.2);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination-link.is-current {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.has-background-light {
    background-color: #f8f9fa !important;
}

/* Image lazy loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 768px) {
    .hero.is-medium .hero-body {
        padding: 3rem 1.5rem;
    }
    
    .section {
        padding: 2rem 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .date-badge {
        min-width: 60px;
    }
    
    .date-badge .is-size-4 {
        font-size: 1.25rem !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .navbar,
    .footer,
    .breadcrumb,
    .buttons {
        display: none !important;
    }
    
    .hero {
        background: none !important;
        color: black !important;
    }
    
    .hero .title,
    .hero .subtitle {
        color: black !important;
    }
}

/* ==========================================================================
   Image Gallery Carousel
   ========================================================================== */

.image-carousel-wrapper {
    margin: 2rem 0;
}

.gallery-main {
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    width: 100%;
}

.gallery-main .swiper-slide {
    position: relative;
    height: auto;
}

/* Override Bulma's figure styling for gallery */
.gallery-main .swiper-slide figure.image {
    margin: 0;
    padding: 0;
}

.gallery-main .swiper-slide figure.image.is-16by9 {
    padding-top: 56.25%;
    position: relative;
}

.gallery-main .swiper-slide figure.image.is-16by9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-main .gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-main .gallery-image:hover {
    transform: scale(1.02);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1.5rem 1rem 1rem;
}

.gallery-caption p {
    margin: 0;
}

/* Thumbnail gallery */
.gallery-thumbs {
    padding: 0.5rem 0;
}

.gallery-thumbs .swiper-slide {
    opacity: 0.6;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.gallery-thumbs .swiper-slide:hover,
.gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.gallery-thumbs .swiper-slide-thumb-active {
    box-shadow: 0 0 0 3px var(--primary);
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Swiper navigation customization */
.gallery-main .swiper-button-next,
.gallery-main .swiper-button-prev {
    color: white;
    background-color: rgba(0, 0, 0, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

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

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

.gallery-main .swiper-pagination-bullet {
    background-color: white;
    opacity: 0.6;
}

.gallery-main .swiper-pagination-bullet-active {
    background-color: var(--primary);
    opacity: 1;
}

/* Lightbox styles */
.gallery-lightbox .modal-content {
    padding: 1rem;
}

.gallery-lightbox-swiper .swiper-button-next,
.gallery-lightbox-swiper .swiper-button-prev {
    color: white;
}

.gallery-lightbox .modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
}

/* ==========================================================================
   CKEditor Content Styling
   ========================================================================== */

.ck-content {
    min-height: 300px;
}

.ck-content img {
    max-width: 100%;
    height: auto;
}

.ck-content figure.image {
    margin: 1.5rem 0;
}

.ck-content figure.image figcaption {
    padding: 0.5rem;
    background-color: #f5f5f5;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.ck-content figure.image-style-side {
    float: right;
    margin-left: 1.5rem;
    max-width: 50%;
}

/* Article content styling for rendered CKEditor content */
/* Override Bulma's default which forces images to 100% width */
.article-content.content img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 4px;
}

.article-content.content figure {
    display: inline-block;
    margin: 1rem 0;
}

.article-content.content figure.image {
    margin: 1.5rem 0;
    text-align: center;
}

.article-content.content figure.image img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 4px;
}

/* CKEditor image styles - preserve inline/side/block positioning */
.article-content.content figure.image-style-side {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 50%;
    clear: right;
}

.article-content.content figure.image-style-align-left {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 50%;
    clear: left;
}

.article-content.content figure.image-style-align-center,
.article-content.content figure.image-style-block-align-center {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
}

.article-content.content figure.image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    text-align: center;
}

/* Clear floats after content */
.article-content.content::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Simplified Gallery Carousel (without Bulma figures)
   ========================================================================== */

.gallery-slide-inner {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background-color: #1a1a1a;
}

.gallery-slide-inner .gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 2rem 1rem 1rem;
    color: white;
}

.gallery-caption .caption-text {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.gallery-caption .credit-text {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Thumbnail images without Bulma figures */
.gallery-thumbs .swiper-slide {
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox image styling */
.lightbox-image {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
