/* ==========================================================================
   Ahimsa Updates – Monthly Newsletter Styles
   ========================================================================== */

:root {
    --aupd-radius: 12px;
    --aupd-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --aupd-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --aupd-transition: 0.25s ease;
    --aupd-gap: 28px;
    --aupd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --aupd-text: #1a1a2e;
    --aupd-text-muted: #555;
    --aupd-bg: #f8f9fa;
    --aupd-card-bg: #ffffff;
    --aupd-border: #e5e7eb;
    --aupd-accent: #667eea;
    --aupd-accent-dark: #5a67d8;
}

.aupd-container {
    width: 100%;
    max-width: min(1200px, 100%);
    margin: 0 auto;
    padding: 20px clamp(16px, 3vw, 40px) 40px;
    font-family: var(--aupd-font);
    color: var(--aupd-text);
    box-sizing: border-box;
}

/* ---------- Archive Header ---------- */

.aupd-header {
    text-align: center;
    margin-bottom: 40px;
}

.aupd-header__title {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
    color: var(--aupd-text);
}

.aupd-header__subtitle {
    font-size: clamp(16px, 2.5vw, 18px);
    color: var(--aupd-text-muted);
    margin: 0;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Section tabs ---------- */

.aupd-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 36px;
}

.aupd-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid var(--aupd-border);
    border-radius: 999px;
    background: var(--aupd-card-bg);
    color: var(--aupd-text-muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all var(--aupd-transition);
}

.aupd-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
}

.aupd-tab:hover {
    border-color: var(--aupd-text);
    color: var(--aupd-text);
}

.aupd-tab--active,
.aupd-tab[aria-selected="true"] {
    background: var(--aupd-text);
    border-color: var(--aupd-text);
    color: #fff;
}

.aupd-tab-panel[hidden] {
    display: none;
}

/* The events section leads its tab panel, so it needs no top divider here. */
.aupd-tab-panel .aupd-upcoming {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ---------- Archive Card Grid ---------- */

.aupd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--aupd-gap);
}

@media (max-width: 960px) {
    .aupd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .aupd-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Archive Card ---------- */

.aupd-card {
    background: var(--aupd-card-bg);
    border-radius: var(--aupd-radius);
    box-shadow: var(--aupd-shadow);
    overflow: hidden;
    transition: transform var(--aupd-transition), box-shadow var(--aupd-transition);
}

.aupd-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aupd-shadow-hover);
}

.aupd-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.aupd-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, var(--aupd-accent), var(--aupd-accent-dark));
    overflow: hidden;
}

.aupd-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aupd-card__image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aupd-card__month-badge {
    font-size: clamp(28px, 6vw, 42px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aupd-card__date-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.aupd-card__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aupd-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
    color: var(--aupd-text);
}

.aupd-card__excerpt {
    font-size: 14px;
    color: var(--aupd-text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
    flex: 1;
}

.aupd-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.aupd-card__highlight-count {
    color: var(--aupd-text-muted);
}

.aupd-card__read-more {
    color: var(--aupd-accent);
    font-weight: 600;
}

/* ---------- Upcoming Events Card (Inline Alert) ---------- */

.aupd-card--events {
    border: 2px solid #16a34a;
}

.aupd-card--events:hover {
    border-color: #15803d;
}

.aupd-card__image-wrap--events {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.aupd-card__events-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.aupd-card__events-icon svg {
    stroke: currentColor;
    opacity: 0.9;
}

.aupd-card__events-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: #fff;
    color: #16a34a;
    font-size: 16px;
    font-weight: 700;
    border-radius: 16px;
    padding: 0 10px;
}

.aupd-card--events .aupd-card__title {
    color: #16a34a;
}

.aupd-card--events .aupd-card__read-more {
    color: #16a34a;
}

.aupd-card--past-events {
    border: 2px solid #64748b;
}

.aupd-card--past-events:hover {
    border-color: #475569;
}

.aupd-card__image-wrap--past-events {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.aupd-card--past-events .aupd-card__events-badge {
    color: #475569;
}

.aupd-card--past-events .aupd-card__title,
.aupd-card--past-events .aupd-card__read-more {
    color: #475569;
}

.aupd-empty {
    text-align: center;
    color: var(--aupd-text-muted);
    padding: 60px 20px;
    font-size: 16px;
}

.aupd-not-found {
    text-align: center;
    padding: 60px 20px;
}

.aupd-not-found h2 {
    margin: 0 0 16px;
    color: var(--aupd-text);
}

.aupd-not-found a {
    color: var(--aupd-accent);
    text-decoration: none;
    font-weight: 500;
}

.aupd-not-found a:hover {
    text-decoration: underline;
}

/* ---------- Single Update Page ---------- */

.aupd-single {
    max-width: 100%;
}

.aupd-breadcrumb {
    margin-bottom: 24px;
}

.aupd-breadcrumb a {
    color: var(--aupd-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--aupd-transition);
}

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

.aupd-single__header {
    margin-bottom: 40px;
    text-align: center;
}

.aupd-single__date {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--aupd-accent), var(--aupd-accent-dark));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    margin-bottom: 16px;
    letter-spacing: 0.03em;
}

.aupd-single__title {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.2;
    color: var(--aupd-text);
}

.aupd-single__intro {
    font-size: clamp(16px, 2.5vw, 18px);
    color: var(--aupd-text-muted);
    margin: 0;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Section Titles ---------- */

.aupd-section__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--aupd-text);
    text-align: center;
    text-transform: none;
}

/* ---------- Highlights Section ---------- */

.aupd-highlights {
    margin-bottom: 60px;
}

.aupd-highlights__grid {
    column-count: 3;
    column-gap: var(--aupd-gap);
}

@media (max-width: 900px) {
    .aupd-highlights__grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .aupd-highlights__grid {
        column-count: 1;
    }
}

.aupd-highlight {
    background: var(--aupd-card-bg);
    border-radius: var(--aupd-radius);
    box-shadow: var(--aupd-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    margin-bottom: var(--aupd-gap);
    transition: transform var(--aupd-transition), box-shadow var(--aupd-transition);
}

.aupd-highlight--youtube-card {
    cursor: pointer;
}

.aupd-highlight--youtube-card:focus-visible {
    outline: 2px solid var(--aupd-accent);
    outline-offset: 2px;
}

/* Entire card is one link (external / non-YouTube, no gallery) */
.aupd-highlight__hit {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    color: inherit;
    text-decoration: none;
}

.aupd-highlight__hit:focus-visible {
    outline: 2px solid var(--aupd-accent);
    outline-offset: 2px;
}

.aupd-highlight__hit .aupd-highlight__title {
    color: var(--aupd-text);
}

.aupd-highlight__hit .aupd-highlight__summary {
    color: var(--aupd-text-muted);
}

.aupd-highlight:hover {
    transform: translateY(-4px);
    box-shadow: var(--aupd-shadow-hover);
}

.aupd-highlight__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--aupd-bg);
    overflow: hidden;
}

.aupd-highlight__image-wrap--gallery::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.aupd-highlight__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--aupd-bg);
}

.aupd-highlight__gallery-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.aupd-highlight__gallery-count svg {
    flex-shrink: 0;
    stroke: #fff;
}

.aupd-highlight__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aupd-highlight__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
    color: var(--aupd-text);
}

.aupd-highlight__summary {
    font-size: 15px;
    color: var(--aupd-text-muted);
    margin: 0;
    line-height: 1.6;
    flex: 1;
}

.aupd-highlight__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--aupd-accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--aupd-transition);
}

.aupd-highlight__link:hover {
    color: var(--aupd-accent-dark);
}

.aupd-highlight__link svg {
    flex-shrink: 0;
    stroke: currentColor;
}

/* ---------- Image Gallery ---------- */

.aupd-gallery {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: var(--aupd-bg);
    overflow: hidden;
}

.aupd-gallery__track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.aupd-gallery__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.aupd-gallery__slide--active {
    opacity: 1;
    pointer-events: auto;
}

.aupd-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--aupd-bg);
}

.aupd-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.aupd-gallery__arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.aupd-gallery__arrow--prev {
    left: 10px;
}

.aupd-gallery__arrow--next {
    right: 10px;
}

.aupd-gallery__arrow svg {
    stroke: var(--aupd-text);
}

.aupd-gallery__arrow--pulse {
    animation: aupd-arrow-pulse 1.5s ease-in-out infinite;
}

@keyframes aupd-arrow-pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-50%) scale(1);
    }
    50% { 
        box-shadow: 0 2px 16px rgba(102, 126, 234, 0.5);
        transform: translateY(-50%) scale(1.15);
    }
}

.aupd-gallery__counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

@media (max-width: 600px) {
    .aupd-gallery__arrow {
        width: 36px;
        height: 36px;
    }
    
    .aupd-gallery__arrow--prev {
        left: 6px;
    }
    
    .aupd-gallery__arrow--next {
        right: 6px;
    }
    
    .aupd-gallery__counter {
        bottom: 8px;
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ---------- YouTube Video Support ---------- */

.aupd-highlight__image-wrap--video {
    cursor: pointer;
}

.aupd-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    padding: 0;
    cursor: inherit;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 5;
}

.aupd-highlight__image-wrap--video:hover .aupd-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.aupd-highlight__link--video {
    display: inline-flex;
    align-items: center;
}

/* YouTube Modal */
.aupd-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.aupd-video-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.aupd-video-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.aupd-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aupd-video-modal__content {
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.aupd-video-modal__content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------- CTAs Section ---------- */

.aupd-ctas {
    margin-bottom: 60px;
}

.aupd-ctas__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 1000px) {
    .aupd-ctas__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .aupd-ctas__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .aupd-ctas__grid {
        grid-template-columns: 1fr;
    }
}

.aupd-cta {
    background: var(--aupd-card-bg);
    border-radius: var(--aupd-radius);
    box-shadow: var(--aupd-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    transition: border-color var(--aupd-transition), box-shadow var(--aupd-transition);
}

.aupd-cta:hover {
    border-color: var(--aupd-accent);
    box-shadow: var(--aupd-shadow-hover);
}

.aupd-cta__image-wrap {
    position: relative;
    width: 100%;
    background: var(--aupd-bg);
    overflow: hidden;
}

.aupd-cta__image {
    width: 100%;
    height: auto;
    display: block;
}

.aupd-cta__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.aupd-cta__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
    color: var(--aupd-text);
}

.aupd-cta__summary {
    font-size: 14px;
    color: var(--aupd-text-muted);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.aupd-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--aupd-accent), var(--aupd-accent-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: transform var(--aupd-transition), box-shadow var(--aupd-transition);
}

.aupd-cta__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* ---------- Footer ---------- */

.aupd-single__footer {
    text-align: center;
    padding: 32px 20px;
    background: var(--aupd-bg);
    border-radius: var(--aupd-radius);
    margin-top: 40px;
}

.aupd-single__footer p {
    margin: 0;
    font-size: 15px;
    color: var(--aupd-text-muted);
}

.aupd-single__footer a {
    color: var(--aupd-accent);
    text-decoration: none;
    font-weight: 500;
}

.aupd-single__footer a:hover {
    text-decoration: underline;
}

/* ---------- Responsive adjustments ---------- */

@media (max-width: 600px) {
    .aupd-container {
        padding: 16px 16px 40px;
    }

    .aupd-header {
        margin-bottom: 28px;
    }

    .aupd-single__header {
        margin-bottom: 32px;
    }

    .aupd-highlights,
    .aupd-ctas {
        margin-bottom: 40px;
    }

    .aupd-section__title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .aupd-highlight__body,
    .aupd-cta__body {
        padding: 16px;
    }
}
