/**
 * Stylesheet: gw-story-blocks.css
 * Gary Wallage Photography - High Quality, Elegant, Privacy-Respecting Blocks
 */

/* Story Block Container & Outer Margins */
.gw-story-block-section,
.gw-story-chapter {
    position: relative;
    width: 100%;
    background: #0d0d0d;
    color: #e0d8cc;
    padding: 60px 0;
    box-sizing: border-box;
}

.gw-story-block-container.has-outer-margins,
.gw-chapter-stripe-inner.has-outer-margins {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    width: 100%;
}

/* Grids with Dynamic Columns */
.gw-stories-grid,
.gw-chapter-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gw-cols, 3), minmax(0, 1fr));
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .gw-stories-grid,
    .gw-chapter-gallery-grid {
        grid-template-columns: repeat(min(var(--gw-cols, 3), 2), minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .gw-stories-grid,
    .gw-chapter-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gw-story-block-section,
    .gw-story-chapter {
        padding: 40px 0;
    }
    .gw-story-block-container.has-outer-margins,
    .gw-chapter-stripe-inner.has-outer-margins {
        padding: 0 16px;
    }
}

/* Chapter Header */
.gw-chapter-header {
    text-align: center;
    max-width: 950px;
    margin: 0 auto 40px auto;
}

.gw-chapter-badge {
    display: inline-block;
    color: #B08D55;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.gw-chapter-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 16px 0;
    font-weight: 400;
}

.gw-chapter-lead {
    font-family: 'Lato', sans-serif;
    font-size: clamp(0.98rem, 1.6vw, 1.15rem);
    line-height: 1.65;
    color: #cfc8be;
    margin: 0 auto;
}

/* Cards & Even Image Containers */
.gw-wedding-card,
.gw-photo-card {
    background: #151515;
    border: 1px solid #262626;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.gw-photo-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.gw-photo-card-link:hover .gw-photo-card,
.gw-wedding-card:hover {
    transform: translateY(-4px);
    border-color: #B08D55;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.gw-card-thumb-wrap,
.gw-photo-img-wrap {
    width: 100%;
    position: relative;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.gw-card-thumb-wrap img,
.gw-photo-img-wrap img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.4s ease;
}

.gw-photo-card-link:hover .gw-photo-img-wrap img,
.gw-wedding-card:hover .gw-card-thumb-wrap img {
    /* No hover scale or zoom on images */
}

/* Image Alignment Modifiers */
img[style*="object-position: top"] {
    object-position: top center !important;
}
img[style*="object-position: center"] {
    object-position: center center !important;
}
img[style*="object-position: bottom"] {
    object-position: bottom center !important;
}

/* Card Body & Captions ("Paragraphs") */
.gw-card-body,
.gw-photo-caption {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.gw-card-body h3,
.gw-photo-caption h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.gw-card-badge,
.gw-wedding-collection-tag {
    color: #B08D55;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: block;
}

.gw-card-body p,
.gw-photo-caption p {
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #b5ada3;
    margin: 0 0 16px 0;
    flex: 1;
}

.gw-card-link,
.gw-cta-arrow {
    color: #B08D55;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.gw-card-link:hover {
    color: #ffd899;
}

/* Placeholder */
.gw-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.85rem;
}

/* Gutenberg Editor-Specific Tweaks */
.wp-block[data-type="gw/story-block"],
.wp-block[data-type="gw/chapter-stripe"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.gw-editor-photo-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.gw-editor-photo-card {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    color: #eee;
}

.gw-editor-photo-card.is-selected {
    border-color: #B08D55;
    box-shadow: 0 0 0 1px #B08D55;
}

.gw-align-btn-group {
    display: inline-flex;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid #444;
}

.gw-align-btn-group button {
    background: #2a2a2a;
    border: none;
    color: #aaa;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
}

.gw-align-btn-group button.active {
    background: #B08D55;
    color: #000;
}
