/* ==========================================================================
   Languages Section
   ========================================================================== */

.languages {
    padding: 10rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.languages-header {
    text-align: center;
    margin-bottom: 4rem;
}

.languages-title {
    font-size: 3rem;
    font-weight: 300;
}

.languages-subtitle {
    font-size: 1.15rem;
    color: var(--ink-muted);
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Primary Languages Grid (English & German side by side) */
.language-primary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Featured Language Card */
.language-primary {
    margin-bottom: 3rem;
}

.language-card-featured {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--cream-dark);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.language-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--terracotta), var(--gold));
}

.language-card-featured:hover {
    box-shadow: 0 20px 60px rgba(26, 25, 21, 0.1);
    transform: translateY(-3px);
}

.language-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.language-badge {
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--terracotta);
    margin-bottom: 0.5rem;
}

.language-card-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--ink);
}

.language-card-content p {
    font-size: 1.05rem;
    color: var(--ink-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.language-stats {
    display: flex;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--terracotta);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.language-card {
    background: var(--paper);
    border: 1px solid var(--cream-dark);
    padding: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(26, 25, 21, 0.1);
}

.language-card-body {
    padding: 1.5rem;
}

.language-card-body h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--ink);
}

.proficiency-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--paper);
    background: var(--terracotta);
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.75rem;
}

.language-card-body p {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.language-years {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--gold);
}

/* Proficiency Bar */
.proficiency-bar-container {
    margin: 1rem 0 0.75rem;
}

.proficiency-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.proficiency-bar-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}

.proficiency-bar-percent {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}

.proficiency-bar {
    height: 6px;
    background: var(--cream-dark);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.proficiency-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    animation: fillBar 1s ease forwards;
    animation-play-state: paused;
}

.proficiency-bar-fill.is-visible,
.is-visible .proficiency-bar-fill {
    animation-play-state: running;
}

/* Native proficiency (English) */
.proficiency-bar-fill--native {
    background: linear-gradient(90deg, var(--terracotta), var(--terracotta-light));
    --fill-width: 100%;
}

/* Featured Language Proficiency */
.language-card-featured .proficiency-bar-container {
    max-width: 300px;
    margin-top: 1.5rem;
}

.language-card-featured .proficiency-bar {
    height: 8px;
}

/* Flag Styles */
.flag-wrapper {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.language-card-featured .flag-wrapper {
    width: 100%;
    height: 100px;
    border-radius: 4px;
    box-shadow: 0 8px 25px rgba(26, 25, 21, 0.15);
    margin-bottom: 1.5rem;
}

/* UK Flag - Union Jack */
.flag-uk {
    background: var(--flag-blue);
    position: relative;
}

.flag-uk-design {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* White diagonal stripes (St. Andrew's Cross) */
.flag-uk-design::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 141%;
    height: 25%;
    background: var(--flag-white);
    transform-origin: 0 0;
    transform: rotate(12deg);
}

.flag-uk-design::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 141%;
    height: 25%;
    background: var(--flag-white);
    transform-origin: 0 100%;
    transform: rotate(-12deg);
}

/* Red diagonal stripes (St. Patrick's Cross) */
.flag-uk-saltire {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.flag-uk-saltire::before {
    content: '';
    position: absolute;
    top: 6%;
    left: 0;
    width: 141%;
    height: 12%;
    background: var(--flag-red);
    transform-origin: 0 0;
    transform: rotate(12deg);
}

.flag-uk-saltire::after {
    content: '';
    position: absolute;
    bottom: 6%;
    left: 0;
    width: 141%;
    height: 12%;
    background: var(--flag-red);
    transform-origin: 0 100%;
    transform: rotate(-12deg);
}

/* White center cross (St. George's Cross border) */
.flag-uk-cross {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.flag-uk-cross::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 28%;
    background: var(--flag-white);
    transform: translateY(-50%);
}

.flag-uk-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 18%;
    height: 100%;
    background: var(--flag-white);
    transform: translateX(-50%);
}

/* Red center cross (St. George's Cross) */
.flag-uk-cross-red {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.flag-uk-cross-red::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 14%;
    background: var(--flag-red);
    transform: translateY(-50%);
}

.flag-uk-cross-red::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 9%;
    height: 100%;
    background: var(--flag-red);
    transform: translateX(-50%);
}

/* German Flag */
.flag-germany {
    display: flex;
    flex-direction: column;
}

.flag-germany .stripe-black {
    flex: 1;
    background: var(--flag-black);
}

.flag-germany .stripe-red {
    flex: 1;
    background: var(--flag-red);
}

.flag-germany .stripe-gold {
    flex: 1;
    background: var(--flag-gold);
}

/* French Flag */
.flag-france {
    display: flex;
}

.flag-france .stripe-blue {
    flex: 1;
    background: var(--flag-blue);
}

.flag-france .stripe-white {
    flex: 1;
    background: var(--flag-white);
}

.flag-france .stripe-red {
    flex: 1;
    background: var(--flag-red);
}

/* Portuguese Flag */
.flag-portugal {
    display: flex;
    position: relative;
}

.flag-portugal .stripe-green {
    flex: 2;
    background: var(--flag-green);
}

.flag-portugal .stripe-red {
    flex: 3;
    background: var(--flag-red);
}

/* Philosophy Quote */
.language-philosophy {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--cream-dark);
    text-align: center;
}

.language-philosophy blockquote {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 3rem;
    background: linear-gradient(135deg, rgba(196, 120, 90, 0.05) 0%, rgba(184, 151, 110, 0.05) 100%);
    border-left: 3px solid var(--terracotta);
}

.language-philosophy .quote-mark {
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 5rem;
    font-weight: 300;
    color: var(--terracotta);
    opacity: 0.3;
    line-height: 1;
}

.language-philosophy blockquote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* Responsive */
@media (max-width: 1024px) {
    .languages {
        padding: 6rem 2rem;
    }

    .language-primary-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .languages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .language-card-featured .flag-wrapper {
        height: 80px;
    }

}

@media (max-width: 768px) {
    .languages {
        padding: 4rem 1.5rem;
    }

    .languages-grid {
        grid-template-columns: 1fr;
    }

    .languages-title {
        font-size: 2.5rem;
    }

    .language-philosophy blockquote {
        padding: 1.5rem 2rem;
        font-size: 1.2rem;
    }

    .language-philosophy .quote-mark {
        font-size: 4rem;
        top: -0.3rem;
        left: 0.5rem;
    }

    /* Adjust UK flag for mobile - even wider aspect ratio */
    .language-card-featured .flag-uk-design::before {
        transform: rotate(10deg);
    }
    .language-card-featured .flag-uk-design::after {
        transform: rotate(-10deg);
    }
    .language-card-featured .flag-uk-saltire::before {
        transform: rotate(10deg);
    }
    .language-card-featured .flag-uk-saltire::after {
        transform: rotate(-10deg);
    }
}
