/* Main3 — Library Week 2026 modern event landing */
:root {
    --m3-navy: #0c0b2e;
    --m3-navy-mid: #1a1854;
    --m3-indigo: #4f3fd9;
    --m3-accent: #f20487;
    --m3-accent-glow: rgba(242, 4, 135, 0.35);
    --m3-gold: #f5b942;
    --m3-teal: #00c9a7;
    --m3-bg: #f6f7fc;
    --m3-surface: #ffffff;
    --m3-text: #1e2138;
    --m3-muted: #5e6478;
    --m3-border: rgba(18, 17, 74, 0.08);
    --m3-radius: 20px;
    --m3-radius-sm: 12px;
    --m3-shadow: 0 12px 40px rgba(12, 11, 46, 0.08);
    --m3-shadow-lg: 0 24px 64px rgba(12, 11, 46, 0.14);
    --m3-container: min(1200px, 92vw);
    --m3-header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

.m3-page {
    font-family: 'IBM Plex Sans Thai', 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--m3-text);
    background: var(--m3-surface);
    line-height: 1.65;
    margin: 0;
    overflow-x: hidden;
}

.thai-text {
    line-break: strict;
    word-break: normal;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

.thai-keep {
    white-space: nowrap;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.m3-about-bento__text .about-actions {
    align-self: flex-start;
}

@media (max-width: 767px) {
    .thai-keep {
        white-space: normal;
    }
}

.m3-container {
    width: var(--m3-container);
    margin: 0 auto;
}

/* ── Header ── */
.m3-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--m3-header-h);
    transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}

.m3-header.is-scrolled {
    background: rgba(12, 11, 46, 0.88);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.m3-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4vw;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.m3-header__logo img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.m3-nav {
    display: flex;
    align-items: center;
    gap: 4px 6px;
}

.m3-nav a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.m3-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.m3-nav__cta {
    background: linear-gradient(135deg, var(--m3-accent) 0%, #e91e8c 100%) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 16px var(--m3-accent-glow);
}

.m3-nav__cta:hover {
    background: linear-gradient(135deg, #d10375 0%, #c9187d 100%) !important;
    transform: translateY(-1px);
}

.m3-nav__link--muted {
    opacity: 0.65;
    font-size: 0.82rem !important;
}

.m3-header__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
}

.m3-header__toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s;
}

/* ── Hero ── */
.m3-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--m3-navy);
}

.m3-hero__bg {
    position: absolute;
    inset: 0;
}

.m3-hero__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: m3HeroFade 30s infinite;
    transform: scale(1.05);
}

.m3-hero__slide:nth-child(1) { animation-delay: 0s; }
.m3-hero__slide:nth-child(2) { animation-delay: 5s; }
.m3-hero__slide:nth-child(3) { animation-delay: 10s; }
.m3-hero__slide:nth-child(4) { animation-delay: 15s; }
.m3-hero__slide:nth-child(5) { animation-delay: 20s; }
.m3-hero__slide:nth-child(6) { animation-delay: 25s; }

@keyframes m3HeroFade {
    0%, 12% { opacity: 1; transform: scale(1); }
    16%, 100% { opacity: 0; transform: scale(1.08); }
}

.m3-hero__mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(79, 63, 217, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 90% 20%, rgba(242, 4, 135, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0, 201, 167, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, rgba(12, 11, 46, 0.55) 0%, rgba(12, 11, 46, 0.92) 100%);
    z-index: 1;
}

.m3-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 75%);
    z-index: 2;
    pointer-events: none;
}

.m3-hero__content {
    position: relative;
    z-index: 3;
    width: var(--m3-container);
    margin: 0 auto;
    padding: calc(var(--m3-header-h) + 48px) 4vw 80px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.m3-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 100px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.m3-hero__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--m3-teal);
    animation: m3Pulse 2s infinite;
}

@keyframes m3Pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.m3-hero__title {
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.m3-hero__title span {
    background: linear-gradient(135deg, var(--m3-gold) 0%, #ffe08a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.m3-hero__desc {
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.08rem;
    line-height: 1.75;
    margin: 0 0 32px;
    max-width: 520px;
}

.m3-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.m3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.m3-btn:hover { transform: translateY(-2px); }

.m3-btn--primary {
    background: linear-gradient(135deg, var(--m3-accent) 0%, #e91e8c 100%);
    color: #fff;
    box-shadow: 0 8px 28px var(--m3-accent-glow);
}

.m3-btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.m3-btn--outline {
    background: transparent;
    color: var(--m3-navy);
    border: 2px solid var(--m3-navy);
}

.m3-btn--outline:hover {
    background: var(--m3-navy);
    color: #fff;
}

.m3-hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.m3-hero__card-stack {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.m3-hero__float-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--m3-radius);
    padding: 24px;
    box-shadow: var(--m3-shadow-lg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.m3-hero__float-card--main {
    position: relative;
    z-index: 2;
    animation: m3Float 6s ease-in-out infinite;
}

.m3-hero__float-card--back {
    position: absolute;
    top: -20px;
    right: -24px;
    width: 85%;
    height: 90%;
    background: linear-gradient(135deg, var(--m3-indigo) 0%, var(--m3-accent) 100%);
    border-radius: var(--m3-radius);
    z-index: 1;
    opacity: 0.7;
    animation: m3Float 6s ease-in-out infinite reverse;
}

@keyframes m3Float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.m3-hero__card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--m3-accent);
    margin-bottom: 8px;
}

.m3-hero__card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--m3-navy);
    margin: 0 0 16px;
    line-height: 1.4;
}

.m3-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.m3-hero__stat {
    text-align: center;
    padding: 12px 8px;
    background: var(--m3-bg);
    border-radius: var(--m3-radius-sm);
}

.m3-hero__stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--m3-indigo);
    line-height: 1.2;
}

.m3-hero__stat-label {
    font-size: 0.72rem;
    color: var(--m3-muted);
    font-weight: 500;
}

.m3-hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-decoration: none;
    animation: m3Bounce 2s infinite;
}

.m3-hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
}

@keyframes m3Bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* ── Quick links bar ── */
.m3-quickbar {
    background: var(--m3-surface);
    border-bottom: 1px solid var(--m3-border);
    padding: 0;
    position: sticky;
    top: var(--m3-header-h);
    z-index: 90;
    box-shadow: 0 2px 12px rgba(12, 11, 46, 0.04);
}

.m3-quickbar__inner {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 4vw;
    max-width: 1200px;
    margin: 0 auto;
    scrollbar-width: none;
}

.m3-quickbar__inner::-webkit-scrollbar { display: none; }

.m3-quickbar a {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--m3-muted);
    text-decoration: none;
    background: var(--m3-bg);
    transition: all 0.2s;
    white-space: nowrap;
}

.m3-quickbar a:hover,
.m3-quickbar a.is-active {
    background: var(--m3-navy);
    color: #fff;
}

/* ── Sections ── */
.m3-section {
    padding: 96px 0;
    position: relative;
}

.m3-section--alt {
    background: var(--m3-bg);
}

.m3-section--dark {
    background: linear-gradient(165deg, var(--m3-navy) 0%, var(--m3-navy-mid) 50%, #12106a 100%);
    color: #fff;
    overflow: hidden;
}

.m3-section--dark::before {
    content: "";
    position: absolute;
    top: -200px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 4, 135, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.m3-section__head {
    text-align: center;
    margin-bottom: 56px;
}

.m3-section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--m3-accent);
    margin-bottom: 12px;
}

.m3-section__eyebrow::before,
.m3-section__eyebrow::after {
    content: "";
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.5;
}

.m3-section--dark .m3-section__eyebrow { color: var(--m3-gold); }

.m3-section__title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--m3-navy);
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.m3-section--dark .m3-section__title { color: #fff; }

.m3-section__desc {
    color: var(--m3-muted);
    max-width: min(720px, 100%);
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.7;
    padding: 0 4px;
}

.m3-section--dark .m3-section__desc { color: rgba(255, 255, 255, 0.72); }

/* ── About bento ── */
.m3-about-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
}

.m3-about-bento__image {
    grid-column: span 5;
    grid-row: span 2;
    border-radius: var(--m3-radius);
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.m3-about-bento__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.m3-about-bento__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(12, 11, 46, 0.1) 0%, transparent 60%);
}

.m3-about-bento__text {
    grid-column: span 7;
    background: var(--m3-surface);
    border-radius: var(--m3-radius);
    padding: 36px 40px;
    box-shadow: var(--m3-shadow);
    border: 1px solid var(--m3-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.m3-about-bento__text p {
    font-size: 1.05rem;
    color: var(--m3-muted);
    line-height: 1.85;
    text-indent: 2em;
    margin: 0 0 28px;
}

.m3-about-bento__features {
    grid-column: span 7;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.m3-feature-pill {
    background: var(--m3-surface);
    border-radius: var(--m3-radius-sm);
    padding: 20px 18px;
    text-align: center;
    border: 1px solid var(--m3-border);
    transition: transform 0.25s, box-shadow 0.25s;
}

.m3-feature-pill:hover {
    transform: translateY(-4px);
    box-shadow: var(--m3-shadow);
}

.m3-feature-pill__icon {
    font-size: 1.75rem;
    margin-bottom: 10px;
    display: block;
}

.m3-feature-pill__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--m3-navy);
    line-height: 1.35;
}

/* ── Speakers ── */
.m3-speakers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

.m3-speaker {
    position: relative;
    border-radius: var(--m3-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.m3-speaker:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}

.m3-speaker__img {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    position: relative;
}

.m3-speaker__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    transition: transform 0.4s;
}

.m3-speaker:hover .m3-speaker__img img {
    transform: scale(1.06);
}

.m3-speaker__img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 11, 46, 0.85) 0%, transparent 55%);
}

.m3-speaker__info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px;
    z-index: 2;
}

.m3-speaker__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.35;
}

.m3-speaker__org {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    line-height: 1.45;
}

/* ── Events (Main3) ── */
.m3-events {
    position: relative;
    overflow: hidden;
}

.m3-events .m3-container {
    position: relative;
    z-index: 2;
}

.m3-events .m3-section__head {
    margin-bottom: 48px;
}

/* Decorative icons (original events-highlight) */
.m3-events .anim-icons {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    pointer-events: none;
    z-index: 1;
}

.m3-events .anim-icons .icon {
    position: absolute;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.35;
}

.m3-events .mix-icon-1 {
    height: 420px;
    width: 120px;
    background-image: url(../images/icons/mix-icon-1.png);
    left: -80px;
    bottom: 120px;
}

.m3-events .mix-icon-2 {
    height: 200px;
    width: 180px;
    background-image: url(../images/icons/mix-icon-2.png);
    right: -60px;
    bottom: 100px;
}

.m3-events__filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.m3-events__filter-btn {
    padding: 10px 20px;
    border-radius: 100px;
    border: 1.5px solid var(--m3-border);
    background: var(--m3-surface);
    color: var(--m3-muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.m3-events__filter-btn:hover,
.m3-events__filter-btn.is-active {
    background: var(--m3-navy);
    color: #fff;
    border-color: var(--m3-navy);
}

.m3-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.m3-event-card {
    background: var(--m3-surface);
    border-radius: var(--m3-radius);
    border: 1px solid var(--m3-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(12, 11, 46, 0.05);
}

.m3-event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--m3-shadow-lg);
}

/* Poster */
.m3-event-card__poster {
    position: relative;
    width: 100%;
    background: linear-gradient(160deg, #eef1f9 0%, #e4e8f4 100%);
    overflow: hidden;
}

.m3-event-card__poster-link {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.m3-event-card__poster-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.35s ease;
}

.m3-event-card__poster-img--fallback {
    object-fit: contain;
    padding: 32px;
    background: linear-gradient(160deg, #f4f6fc 0%, #eef1f9 100%);
    box-sizing: border-box;
}

.m3-event-card:hover .m3-event-card__poster-img {
    transform: scale(1.03);
}

.m3-event-card__poster-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    color: var(--m3-muted);
    background: linear-gradient(160deg, #f4f6fc 0%, #eef1f9 100%);
}

.m3-event-card__poster-placeholder i {
    font-size: 2.5rem;
    color: var(--m3-indigo);
    opacity: 0.5;
}

.m3-event-card__poster-placeholder span {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--m3-navy);
}

.m3-event-card__date-badge--on-poster {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.m3-event-card__status--on-poster {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.m3-event-card__status--on-poster.m3-event-card__status--open {
    background: #22c55e;
    color: #fff;
}

.m3-event-card__status--on-poster.m3-event-card__status--closed {
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
}

.m3-event-card__schedule {
    padding: 14px 24px;
    border-bottom: 1px solid var(--m3-border);
    background: #fff;
}

/* ── Schedule hero (date + time) — ทุกการ์ดใช้รูปแบบเดียวกัน ── */
.m3-event-card__time-hero {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -14px 20px 0;
    padding: 7px 11px;
    border-radius: 11px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 42%),
        linear-gradient(125deg, #0c0b2e 0%, #1a1854 42%, #4f3fd9 100%);
    box-shadow:
        0 8px 20px rgba(12, 11, 46, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

.m3-time-hero__icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.72rem;
    color: #fff;
    background: linear-gradient(145deg, #4f3fd9 0%, #6b5ce7 100%);
    box-shadow: 0 0 0 2px rgba(79, 63, 217, 0.25);
}

.m3-time-hero__content {
    min-width: 0;
    flex: 1;
}

.m3-time-hero__value {
    margin: 0;
    font-size: clamp(0.78rem, 1.7vw, 0.88rem);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: #fff;
    text-wrap: balance;
}

.m3-time-hero__sep {
    margin: 0 0.35em;
    opacity: 0.55;
    font-weight: 400;
}

/* โฟกัสเวลา — สีชมพู */
.m3-event-card--time-focus {
    border-color: rgba(242, 4, 135, 0.18);
    box-shadow: 0 8px 32px rgba(12, 11, 46, 0.1), 0 0 0 1px rgba(242, 4, 135, 0.06);
}

.m3-event-card--time-focus:hover {
    box-shadow: 0 20px 48px rgba(12, 11, 46, 0.16), 0 0 0 1px rgba(242, 4, 135, 0.12);
}

.m3-event-card__time-hero--focus {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, transparent 45%),
        linear-gradient(125deg, #c91d72 0%, #f20487 38%, #4f3fd9 100%);
    box-shadow:
        0 8px 22px rgba(242, 4, 135, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.m3-event-card__time-hero--focus .m3-time-hero__icon {
    background: linear-gradient(145deg, #f20487 0%, #ff4da6 100%);
    box-shadow:
        0 0 0 2px rgba(242, 4, 135, 0.28),
        0 5px 12px rgba(242, 4, 135, 0.4);
}

.m3-event-card__time-hero--focus .m3-time-hero__time {
    font-weight: 800;
}

.m3-time-hero__shine {
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.2) 48%, transparent 100%);
    transform: skewX(-18deg);
    pointer-events: none;
    animation: m3-time-shine 4.5s ease-in-out infinite;
}

.m3-event-card--has-schedule .m3-event-card__body {
    padding-top: 10px;
}

@keyframes m3-time-shine {
    0%, 72% { left: -120%; opacity: 0; }
    78% { opacity: 1; }
    100% { left: 140%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .m3-time-hero__shine {
        animation: none;
    }
}

@media (max-width: 480px) {
    .m3-event-card__time-hero {
        margin-inline: 16px;
    }
}

.m3-event-card__date-badge {
    flex-shrink: 0;
    width: 64px;
    text-align: center;
    background: linear-gradient(135deg, var(--m3-navy) 0%, var(--m3-indigo) 100%);
    color: #fff;
    border-radius: var(--m3-radius-sm);
    padding: 12px 8px;
}

.m3-event-card__date-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.m3-event-card__date-month {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 4px;
    text-transform: uppercase;
}

.m3-event-card__time {
    font-size: 0.82rem;
    color: var(--m3-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m3-event-card__status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
}

.m3-event-card__status--open {
    background: rgba(0, 201, 167, 0.15);
    color: #009e82;
}

.m3-event-card__status--closed {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.m3-event-card__body {
    padding: 20px 24px;
    flex: 1;
}

.m3-event-card__title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--m3-navy);
    margin: 0 0 16px;
    line-height: 1.45;
}

.m3-event-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.m3-event-card__title a:hover { color: var(--m3-indigo); }

.m3-event-card__meta {
    list-style: none;
    margin: 0;
    padding: 0;
}

.m3-event-card__meta li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--m3-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}

.m3-event-card__meta li:last-child { margin-bottom: 0; }

.m3-event-card__meta img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.7;
}

.m3-event-card__meta strong {
    color: var(--m3-navy);
    font-weight: 600;
}

.m3-event-card__footer {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    background: linear-gradient(180deg, #f8f9fd 0%, #f3f5fb 100%);
    border-top: 1px solid var(--m3-border);
}

.m3-event-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.m3-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.2;
}

.m3-event-btn i {
    font-size: 0.82em;
    opacity: 0.95;
}

.m3-event-btn--lead {
    width: 100%;
    min-height: 44px;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}

.m3-event-btn--accent {
    background: linear-gradient(135deg, var(--m3-accent) 0%, #e91e8c 100%);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(242, 4, 135, 0.22);
}

.m3-event-btn--accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(242, 4, 135, 0.28);
}

.m3-event-btn--outline {
    background: #fff;
    color: var(--m3-navy) !important;
    border-color: rgba(18, 17, 74, 0.12);
    box-shadow: 0 1px 2px rgba(12, 11, 46, 0.05);
}

.m3-event-btn--outline:hover {
    border-color: rgba(18, 17, 74, 0.22);
    background: #fff;
    box-shadow: 0 4px 12px rgba(12, 11, 46, 0.08);
}

.m3-event-btn--blue {
    background: #fff;
    color: #1d4ed8 !important;
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.m3-event-btn--blue:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}

.m3-event-btn--warm {
    background: #fff;
    color: #c2410c !important;
    border-color: rgba(234, 88, 12, 0.28);
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.08);
}

.m3-event-btn--warm:hover {
    transform: translateY(-1px);
    background: #fff7ed;
    border-color: rgba(234, 88, 12, 0.45);
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.14);
}

.m3-event-btn--navy {
    background: #fff;
    color: var(--m3-navy) !important;
    border-color: rgba(12, 11, 46, 0.16);
    box-shadow: 0 1px 2px rgba(12, 11, 46, 0.06);
}

.m3-event-btn--navy:hover {
    transform: translateY(-1px);
    background: #f4f5fa;
    border-color: rgba(12, 11, 46, 0.28);
}

.m3-event-btn--staff {
    background: #fff;
    color: #0369a1 !important;
    border-color: rgba(14, 165, 233, 0.28);
    box-shadow: 0 1px 2px rgba(14, 165, 233, 0.08);
}

.m3-event-btn--staff:hover {
    transform: translateY(-1px);
    background: #f0f9ff;
    border-color: rgba(14, 165, 233, 0.45);
}

/* ── Partners ── */
.m3-partners {
    position: relative;
    padding: 96px 0;
    background: var(--m3-navy);
    overflow: hidden;
}

.m3-partners::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(../images/icons/pattern-1.png);
    background-position: right top;
    opacity: 0.06;
    pointer-events: none;
}

.m3-partners .m3-section__title { color: #fff; }
.m3-partners .m3-section__desc { color: rgba(255,255,255,0.7); }
.m3-partners .m3-section__eyebrow { color: var(--m3-gold); }

.m3-partners__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.m3-partners__logo {
    background: #fff;
    border-radius: var(--m3-radius-sm);
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.m3-partners__logo:hover {
    transform: translateY(-6px) scale(1.02);
}

.m3-partners__logo img {
    max-height: 64px;
    max-width: 160px;
    object-fit: contain;
}

.m3-partners__logo a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Location ── */
.m3-location {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

.m3-location__tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.m3-location__tab {
    text-align: left;
    padding: 16px 20px;
    border: 1.5px solid var(--m3-border);
    border-radius: var(--m3-radius-sm);
    background: var(--m3-surface);
    color: var(--m3-navy);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.m3-location__tab.is-active,
.m3-location__tab:hover {
    background: var(--m3-navy);
    color: #fff;
    border-color: var(--m3-navy);
    box-shadow: var(--m3-shadow);
}

.m3-location__panel {
    display: none;
    border-radius: var(--m3-radius);
    overflow: hidden;
    box-shadow: var(--m3-shadow);
    border: 1px solid var(--m3-border);
}

.m3-location__panel.is-active { display: block; }

.m3-location__panel h3 {
    text-align: center;
    padding: 18px;
    margin: 0;
    background: linear-gradient(135deg, var(--m3-navy) 0%, var(--m3-indigo) 100%);
    color: #fff;
    font-size: 1.1rem;
}

.m3-location__panel img {
    width: 100%;
    height: auto;
    display: block;
}

.m3-section__empty {
    text-align: center;
    color: var(--m3-muted);
    padding: 40px;
    grid-column: 1 / -1;
}

/* ── Contact / Footer ── */
.m3-footer {
    background: linear-gradient(180deg, var(--m3-navy-mid) 0%, var(--m3-navy) 100%);
    color: #fff;
    padding: 80px 0 32px;
}

.m3-footer__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.m3-footer__brand {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.m3-footer__info p,
.m3-footer__info a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    margin: 0 0 14px;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.55;
}

.m3-footer__info a:hover { color: var(--m3-gold); }

.m3-footer__info i {
    width: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.7;
}

.m3-footer__map {
    border-radius: var(--m3-radius);
    overflow: hidden;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.m3-footer__map iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: 0;
}

.m3-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.m3-footer__copy {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

.m3-footer__links {
    display: flex;
    gap: 20px;
}

.m3-footer__links a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.m3-footer__links a:hover { color: #fff; }

/* ── Back to top ── */
.m3-back-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--m3-accent) 0%, #e91e8c 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px var(--m3-accent-glow);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}

.m3-back-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.m3-back-top:hover { transform: translateY(-3px); }

/* ── Reveal animation ── */
.m3-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.m3-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Legacy Main / pages without reveal script — always show content */
.m3-static .m3-reveal {
    opacity: 1;
    transform: none;
}

/* ── Embedded in legacy Main / Main2 pages ── */
.m2-embed .m3-section,
.page-wrapper .m3-section {
    font-family: 'IBM Plex Sans Thai', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.page-wrapper .m3-section {
    position: relative;
    z-index: 1;
}

.page-wrapper .m3-section--alt {
    background: var(--m3-bg);
}

.page-wrapper .events-highlight--modern.m3-events {
    background: linear-gradient(160deg, #f4f6fc 0%, #eef1f9 45%, #f8f9ff 100%);
}

.page-wrapper .m3-container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}
.m2-embed .m3-section__head,
.m2-section .m3-section__head,
.sponsor-section .m3-section__head {
    text-align: center;
    margin-bottom: 48px;
}

.m2-section--dark .m3-section__eyebrow,
.sponsor-section .m3-section__eyebrow {
    color: var(--m3-gold);
}

.m2-section--dark .m3-section__title,
.sponsor-section .m3-section__title {
    color: #fff;
}

.m2-section--dark .m3-section__desc,
.sponsor-section .m3-section__desc {
    color: rgba(255, 255, 255, 0.72);
}

.m2-embed .m3-container,
.m2-section .m3-container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .m3-hero__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .m3-hero__desc { margin-left: auto; margin-right: auto; }
    .m3-hero__actions { justify-content: center; }
    .m3-hero__visual { display: none; }

    .m3-about-bento {
        grid-template-columns: 1fr;
    }

    .m3-about-bento__image,
    .m3-about-bento__text,
    .m3-about-bento__features {
        grid-column: span 1;
        grid-row: auto;
    }

    .m3-about-bento__image { min-height: 280px; }
    .m3-about-bento__features { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
    .m3-header__toggle { display: flex; }

    .m3-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(12, 11, 46, 0.98);
        backdrop-filter: blur(16px);
        padding: 16px 4vw 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        gap: 4px;
    }

    .m3-nav.is-open { display: flex; }

    .m3-header { background: rgba(12, 11, 46, 0.95); }

    .m3-section { padding: 64px 0; }

    .m3-about-bento__features { grid-template-columns: 1fr; }

    .m3-event-grid { grid-template-columns: 1fr; }

    .m3-events .mix-icon-1,
    .m3-events .mix-icon-2 {
        display: none;
    }

    .m3-location { grid-template-columns: 1fr; }

    .m3-location__tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .m3-footer__grid { grid-template-columns: 1fr; }

    .m3-footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .m3-event-card__footer { flex-direction: column; }
    .m3-event-btn { width: 100%; text-align: center; }

    .m3-quickbar { display: none; }
}
