/* /app/static/significantstories_com/css/home.css */
/* Homepage-specific styles */

/* --- Hero Section --- */
.hero {
    position: relative;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

/* --- Hero Logo Background --- */
.hero-logo {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
    padding: 0.25rem;
    padding-left: 20%;
}

.hero-logo .site-logo {
    max-width: 600px;
    max-height: 100%;
    width: auto;
    height: auto;
}

.hero-logo .logo-star {
    /* Start faint blue, will animate to gold after flourish completes */
    fill: #3498db;
    opacity: 0.08;
    transition: opacity 1.2s ease-out, fill 1.2s ease-out;
}

.hero-logo .logo-star.animate-to-gold {
    fill: #d4a537;
    opacity: 0.35;
}

.hero-logo .logo-flourish {
    /* Reveal animation from bottom to top using clip-path */
    fill: #3498db;
    opacity: 0.08;
    clip-path: inset(100% 0 0 0);
    animation: reveal-flourish 2s ease-out 0.3s forwards;
}

@keyframes reveal-flourish {
    from {
        clip-path: inset(100% 0 0 0); /* Hidden - clipped from top */
    }
    to {
        clip-path: inset(0 0 0 0); /* Fully visible */
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-logo .logo-flourish {
        animation: none;
        clip-path: none;
    }
    .hero-logo .logo-star {
        transition: none;
        fill: #d4a537;
        opacity: 0.35;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--serif-font);
    font-size: 3rem;
    color: #2c3e50;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.hero-tagline {
    font-size: 1.25rem;
    color: #5a6a7a;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.hero-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.875rem 2.5rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.35);
}

.hero-cta-main {
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.2;
}

.hero-cta-sub {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.2;
}

.hero-cta:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.45);
    text-decoration: none;
    color: white;
}

/* --- Hero Guest Prompt (for unauthenticated users) --- */
.hero-guest-prompt {
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.hero-guest-link {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-guest-link:hover {
    color: #3498db;
    text-decoration: underline;
}

/* --- Home Features Section --- */
.home-features {
    padding: 1rem 2rem 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.home-features-title {
    font-family: var(--serif-font);
    font-size: 1.75rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
}

.feature-cards-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.feature-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.feature-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background-color: #e8f4fc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card-icon svg {
    width: 28px;
    height: 28px;
    stroke: #3498db;
}

.feature-card-title {
    font-family: var(--serif-font);
    font-size: 1.15rem;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.feature-card-text {
    font-size: 0.95rem;
    color: #5a6a7a;
    margin: 0;
    line-height: 1.5;
}

/* --- Connector lines from all three cards to spanning card --- */
.feature-card-connectors {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.feature-card-connectors span {
    width: 2px;
    height: 1.5rem;
    background-color: #3498db;
}

/* --- Spanning card (full width, links to practices) --- */
.feature-card-spanning {
    display: block;
    width: 100%;
    background-color: #e8f4fc;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.feature-card-spanning:hover {
    background-color: #d4ebf9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    text-decoration: none;
}

.feature-card-spanning .feature-card-title {
    color: #2980b9;
    margin-bottom: 0.25rem;
}

.feature-card-spanning .feature-card-text {
    color: #5a6a7a;
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-cta {
        padding: 0.75rem 2rem;
    }

    .hero-cta-main {
        font-size: 1.05rem;
    }

    .hero-cta-sub {
        font-size: 0.75rem;
    }

    .home-features {
        padding: 0.75rem 1rem 1rem;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    /* On mobile, show single chevron instead of three lines */
    .feature-card-connectors {
        justify-content: center;
        margin: 0.75rem auto 0.5rem;
    }

    .feature-card-connectors span {
        display: none;
    }

    .feature-card-connectors span:nth-child(2) {
        display: block;
        width: auto;
        height: auto;
        background: none;
        color: #3498db;
        font-size: 1rem;
    }

    .feature-card-connectors span:nth-child(2)::before {
        content: "▼";
    }
}


/* ===========================================================================
   ANNOUNCEMENTS SLIDER
   Single-card slider between hero and features section
   =========================================================================== */

.announcements-section {
    padding: 2rem 0;
    background: linear-gradient(180deg, #e9ecef 0%, #f8f9fa 100%);
    border-bottom: 1px solid var(--border-color);
}

/* --- Slider Wrapper with Arrows --- */
.announcements-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 3.5rem;
}

/* --- Arrow Buttons --- */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: white;
    color: #5a6a7a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
}

.carousel-arrow:hover {
    background-color: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.carousel-arrow-left {
    left: 0;
}

.carousel-arrow-right {
    right: 0;
}

/* --- Slider Container --- */
.announcements-carousel {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

/* --- Individual Announcement Card --- */
.announcement-card {
    display: none;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.4s ease;
    height: 100%;
}

.announcement-card.is-active {
    display: flex;
    flex-direction: row;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Card Image (left side) --- */
.announcement-card-image {
    flex: 0 0 280px;
    height: auto;
    min-height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.announcement-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Card Content (right side) --- */
.announcement-card-content {
    flex: 1;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.announcement-card-title {
    font-family: var(--serif-font);
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    line-height: 1.25;
    flex-shrink: 0;
    text-align: center;
}

.announcement-card-text {
    font-size: 0.95rem;
    color: #5a6a7a;
    line-height: 1.55;
    margin: 0;
    flex: 1;
    overflow: hidden;
    position: relative;
    text-align: center;
    /* Flex for vertical centering when content is short */
    display: flex;
    flex-direction: column;
    justify-content: center; /* fallback */
    justify-content: safe center; /* centers if fits, top-aligns if overflows */
}

.announcement-card-text a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.announcement-card-text a:hover {
    text-decoration: underline;
}

/* Fade out effect for overflow content */
.announcement-card-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5rem;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.announcement-card-text p {
    margin: 0 0 0.35rem 0;
}

.announcement-card-text p:first-child {
    margin-top: 0;
}

.announcement-card-text p:last-child {
    margin-bottom: 0;
}

/* Handle strong/bold text */
.announcement-card-text strong {
    color: #2c3e50;
}

/* Style markdown lists with star bullets */
.announcement-card-text ul {
    list-style: none;
    padding: 0;
    padding-left: 1rem;
    margin: 0.35rem 0;
    text-align: left;
    display: inline-block;
}

.announcement-card-text li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.2rem;
}

.announcement-card-text li:last-child {
    margin-bottom: 0;
}

.announcement-card-text li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #3498db;
}

.announcement-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.announcement-card-link:hover {
    color: #2980b9;
}

.announcement-card-link .link-arrow {
    transition: transform 0.2s ease;
}

.announcement-card-link:hover .link-arrow {
    transform: translateX(4px);
}

/* --- Dot Indicators --- */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1.25rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.carousel-dot:hover {
    background-color: #999;
}

.carousel-dot.active {
    background-color: #3498db;
    transform: scale(1.2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .announcements-section {
        padding: 1.5rem 0;
    }

    .announcements-carousel-wrapper {
        padding: 0 3rem;
    }

    .announcements-carousel {
        height: 340px;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .carousel-arrow-left {
        left: 0.5rem;
    }

    .carousel-arrow-right {
        right: 0.5rem;
    }

    /* Stack image and content vertically on mobile */
    .announcement-card.is-active {
        flex-direction: column;
    }

    .announcement-card-image {
        flex: 0 0 140px;
        height: 140px;
        min-height: auto;
    }

    .announcement-card-content {
        flex: 1;
        padding: 0.75rem 1rem 1rem;
        overflow: hidden;
    }

    .announcement-card-title {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    .announcement-card-text {
        font-size: 0.85rem;
        line-height: 1.45;
        justify-content: center;
        justify-content: safe center;
    }

    .announcement-card-text p {
        margin: 0 0 0.25rem 0;
    }
}

/* ===========================================================================
   ANNOUNCEMENT MODAL
   Full content modal for announcements
   =========================================================================== */

.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.announcement-modal[hidden] {
    display: none;
}

.announcement-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}

.announcement-modal-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 700px;
    max-height: 85vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.announcement-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    color: #5a6a7a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.announcement-modal-close:hover {
    background-color: #ffffff;
    color: #2c3e50;
    transform: scale(1.1);
}

.announcement-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.announcement-modal-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.announcement-modal-image:empty {
    display: none;
}

.announcement-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.announcement-modal-title {
    font-family: var(--serif-font);
    font-size: 1.75rem;
    color: #2c3e50;
    margin: 0 0 1.25rem 0;
    line-height: 1.3;
}

.announcement-modal-text {
    font-size: 1.05rem;
    color: #5a6a7a;
    line-height: 1.7;
    text-align: center;
}

.announcement-modal-text a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.announcement-modal-text a:hover {
    text-decoration: underline;
}

/* Style markdown lists with star bullets in modal */
.announcement-modal-text ul {
    list-style: none;
    padding: 0;
    padding-left: 1.5rem;
    margin: 1rem 0;
    text-align: left;
    display: inline-block;
}

.announcement-modal-text li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.announcement-modal-text li:last-child {
    margin-bottom: 0;
}

.announcement-modal-text li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #3498db;
}

.announcement-modal-text p {
    margin: 0 0 1rem 0;
}

.announcement-modal-text p:last-child {
    margin-bottom: 0;
}

.announcement-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.announcement-modal-link:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    color: white;
    text-decoration: none;
}

.announcement-modal-link[hidden] {
    display: none;
}

/* Make card clickable */
.announcement-card[data-modal-trigger] {
    cursor: pointer;
}

.announcement-card[data-modal-trigger]:hover {
    transform: scale(1.01);
}

/* Modal responsive */
@media (max-width: 768px) {
    .announcement-modal {
        padding: 1rem;
    }

    .announcement-modal-container {
        max-height: 90vh;
    }

    .announcement-modal-image {
        height: 180px;
    }

    .announcement-modal-body {
        padding: 1.5rem;
    }

    .announcement-modal-title {
        font-size: 1.4rem;
    }

    .announcement-modal-text {
        font-size: 1rem;
    }
}
