/* ============================================
   DONFACK FORTUNE PORTFOLIO - TEACHING PAGE (TABLET-OPTIMIZED)
   File: teaching.css
   Author: Donfack Fortune
   Description: Fully responsive teaching page with tablet optimization
   Last Updated: 2025
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-primary: #e02b20;
    --color-primary-dark: #b81d16;
    --color-primary-light: #ff3b2f;
    --color-accent: #0493f3;
    --color-text-dark: #111;
    --color-text-medium: #333;
    --color-text-light: #666;
    --color-text-lighter: #888;
    --color-bg-white: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-bg-dark: #070707;
    --color-border: #eee;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-shadow-hover: rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --line-height-base: 1.7;
    --line-height-heading: 1.3;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing Scale (8px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 2.5rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 6rem;

    /* Layout */
    --container-max-width: 1280px;
    --container-padding: 5%;
    --grid-gap: 2rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Shadows */
    --shadow-sm: 0 2px 8px var(--color-shadow);
    --shadow-md: 0 4px 16px var(--color-shadow);
    --shadow-lg: 0 8px 32px var(--color-shadow-hover);

    /* Z-index scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-medium);
    background-color: var(--color-bg-white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: var(--color-text-dark);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: clamp(1.75rem, 4vw + 1rem, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw + 1rem, 2rem);
}

h3 {
    font-size: clamp(1.125rem, 2vw + 0.5rem, 1.5rem);
}

h4 {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.25rem);
}

p {
    margin-bottom: var(--space-4);
    font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Responsive container padding */
@media (min-width: 768px) {
    :root {
        --container-padding: 4%;
    }
}

@media (min-width: 900px) {
    :root {
        --container-padding: 3.5%;
    }
}

@media (min-width: 1024px) {
    :root {
        --container-padding: 2rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link:focus {
    position: fixed;
    top: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    padding: var(--space-4) var(--space-6);
    background: var(--color-primary);
    color: white;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
    z-index: var(--z-modal);
    clip: auto;
    white-space: normal;
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5) 0;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.logo {
    margin: 0;
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.logo a {
    color: var(--color-text-dark);
    transition: color var(--transition-base);
}

.logo a:hover {
    color: var(--color-primary);
}

/* Navigation */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: clamp(1rem, 3vw, 2rem);
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-medium);
    font-weight: var(--font-weight-semibold);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--color-primary);
    background: rgba(224, 43, 32, 0.08);
}

/* Social Links */
.header-social {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    flex-shrink: 0;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.25rem, 5vw, 2.5rem);
    height: clamp(2.25rem, 5vw, 2.5rem);
    border-radius: var(--radius-full);
    background: var(--color-bg-light);
    color: var(--color-text-dark);
    font-size: clamp(1rem, 2vw, 1.125rem);
    transition: all var(--transition-base);
}

.social-link:hover,
.social-link:focus {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 43, 32, 0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: var(--space-10) 0;
    min-height: calc(100vh - 300px);
}

/* ============================================
   TEACHING INTRODUCTION SECTION
   ============================================ */
.teaching-intro {
    margin-bottom: var(--space-12);
}

.intro-text {
    margin-bottom: var(--space-8);
}

.lead-text {
    font-size: clamp(1.125rem, 2vw + 0.5rem, 1.375rem);
    line-height: 1.6;
    color: var(--color-text-dark);
    font-weight: var(--font-weight-normal);
}

/* Course Lists Container */
.courses-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

@media (min-width: 768px) {
    .courses-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

.course-group {
    background: var(--color-bg-light);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary);
}

.course-heading {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-dark);
    margin-bottom: var(--space-4);
}

.course-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-list li {
    position: relative;
    padding-left: var(--space-5);
    margin-bottom: var(--space-3);
    font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
    line-height: var(--line-height-base);
    color: var(--color-text-medium);
}

.course-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

.course-list li:last-child {
    margin-bottom: 0;
}

/* Philosophy Text */
.philosophy-text {
    margin-top: var(--space-8);
    padding: var(--space-6);
    background: linear-gradient(135deg, rgba(224, 43, 32, 0.03) 0%, rgba(4, 147, 243, 0.03) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(224, 43, 32, 0.1);
}

.philosophy-text p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
    color: var(--color-text-medium);
}

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

/* ============================================
   TEACHING GALLERY SECTION
   ============================================ */
.teaching-gallery {
    margin-bottom: var(--space-12);
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-8);
    font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem);
    color: var(--color-text-dark);
    position: relative;
    padding-bottom: var(--space-4);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: var(--grid-gap);
    justify-items: center;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Gallery Cards */
.gallery-item {
    width: 100%;
    max-width: 600px;
}

.gallery-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-light);
    aspect-ratio: 3 / 2;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all var(--transition-slow);
    filter: grayscale(80%) brightness(0.95);
}

.gallery-card:hover .gallery-image {
    filter: grayscale(0%) brightness(1.05);
    transform: scale(1.05);
}

.gallery-image.loaded {
    opacity: 1;
}

.card-content {
    padding: var(--space-5);
    flex: 1;
    display: flex;
    align-items: center;
}

.card-text {
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-dark);
    line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-white);
    padding: var(--space-6) 0;
    text-align: center;
    margin-top: var(--space-12);
}

.footer p {
    margin: 0;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--color-text-light);
    transition: color var(--transition-base);
}

.footer p:hover {
    color: var(--color-primary);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-dropdown);
    display: none;
    align-items: center;
    justify-content: center;
    width: clamp(2.75rem, 6vw, 3.125rem);
    height: clamp(2.75rem, 6vw, 3.125rem);
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
    background: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(224, 43, 32, 0.4);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* ============================================
   TABLET-SPECIFIC OPTIMIZATIONS (768px - 1024px)
   ============================================ */

/* Tablet Portrait (768px - 900px) */
@media (min-width: 768px) and (max-width: 900px) {

    /* Header Optimizations */
    .header {
        padding: var(--space-4) 0;
    }

    .header-wrapper {
        gap: var(--space-5);
        flex-wrap: nowrap;
    }

    .header-logo {
        flex: 0 0 auto;
        min-width: 150px;
    }

    .logo {
        font-size: 1.375rem;
    }

    .header-nav {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-list {
        gap: 1.25rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }

    .header-social {
        flex: 0 0 auto;
        gap: 0.875rem;
    }

    .social-link {
        width: 2.375rem;
        height: 2.375rem;
        font-size: 1.0625rem;
    }

    /* Main content adjustments */
    .main-content {
        padding: 3.5rem 0;
    }

    .teaching-intro {
        margin-bottom: 4.5rem;
    }

    .intro-text {
        margin-bottom: 2.5rem;
    }

    .lead-text {
        font-size: 1.25rem;
        line-height: 1.65;
    }

    /* Course wrapper optimization */
    .courses-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        margin-bottom: 2.5rem;
    }

    .course-group {
        padding: 1.75rem;
    }

    .course-heading {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .course-list li {
        font-size: 1rem;
        margin-bottom: 0.875rem;
    }

    .philosophy-text {
        margin-top: 2.5rem;
        padding: 1.75rem;
    }

    /* Gallery grid optimization */
    .teaching-gallery {
        margin-bottom: 4.5rem;
    }

    .section-title {
        margin-bottom: 2.5rem;
        font-size: 1.75rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }

    .gallery-item {
        max-width: 100%;
    }

    .card-content {
        padding: 1.375rem;
    }

    .card-text {
        font-size: 1.0625rem;
    }

    /* Back to top button */
    .back-to-top {
        bottom: 1.75rem;
        right: 1.75rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    /* Footer */
    .footer {
        padding: 1.75rem 0;
        margin-top: 4.5rem;
    }
}

/* Tablet Landscape (901px - 1024px) */
@media (min-width: 901px) and (max-width: 1024px) {

    /* Header fine-tuning */
    .header {
        padding: 1.375rem 0;
    }

    .header-wrapper {
        gap: 1.75rem;
    }

    .logo {
        font-size: 1.4375rem;
    }

    .nav-list {
        gap: 1.5rem;
    }

    .nav-link {
        padding: 0.625rem 1.125rem;
        font-size: 0.9375rem;
    }

    .social-link {
        width: 2.4375rem;
        height: 2.4375rem;
    }

    /* Content spacing */
    .main-content {
        padding: 3.75rem 0;
    }

    .teaching-intro {
        margin-bottom: 5rem;
    }

    .lead-text {
        font-size: 1.3125rem;
        max-width: 900px;
        margin: 0 auto;
    }

    /* Course wrapper */
    .courses-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.25rem;
        max-width: 900px;
        margin: 0 auto 2.75rem;
    }

    .course-group {
        padding: 1.875rem;
    }

    .philosophy-text {
        max-width: 900px;
        margin: 2.75rem auto 0;
        padding: 1.875rem;
    }

    /* Gallery optimization */
    .section-title {
        margin-bottom: 2.75rem;
        font-size: 1.875rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.875rem;
        max-width: 900px;
        margin: 0 auto;
    }

    .gallery-item {
        max-width: 100%;
    }

    /* Back to top button */
    .back-to-top {
        bottom: 1.875rem;
        right: 1.875rem;
        width: 3.0625rem;
        height: 3.0625rem;
    }
}

/* ============================================
   STANDARD RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile and Small Tablets (below 768px) */
@media (max-width: 767px) {
    :root {
        --grid-gap: 1.5rem;
    }

    .header {
        padding: var(--space-4) 0;
    }

    .header-wrapper {
        flex-direction: column;
        gap: var(--space-4);
    }

    .header-nav {
        width: 100%;
    }

    .nav-list {
        width: 100%;
        justify-content: center;
    }

    .header-social {
        justify-content: center;
    }

    .main-content {
        padding: var(--space-8) 0;
    }

    .teaching-intro {
        margin-bottom: var(--space-10);
    }

    .courses-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .philosophy-text {
        padding: var(--space-5);
    }

    .teaching-gallery {
        margin-bottom: var(--space-10);
    }

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

/* Mobile (480px and below) */
@media (max-width: 480px) {
    :root {
        --grid-gap: 1.25rem;
        --space-10: 3rem;
        --space-12: 4rem;
    }

    .header {
        padding: var(--space-3) 0;
    }

    .header-wrapper {
        gap: var(--space-3);
    }

    .nav-list {
        gap: var(--space-3);
    }

    .nav-link {
        padding: var(--space-2) var(--space-3);
        font-size: 0.875rem;
    }

    .main-content {
        padding: var(--space-6) 0;
    }

    .intro-text {
        margin-bottom: var(--space-6);
    }

    .courses-wrapper {
        gap: var(--space-5);
        margin-bottom: var(--space-6);
    }

    .course-group {
        padding: var(--space-5);
    }

    .philosophy-text {
        margin-top: var(--space-6);
        padding: var(--space-4);
    }

    .section-title {
        margin-bottom: var(--space-6);
    }

    .back-to-top {
        bottom: var(--space-4);
        right: var(--space-4);
    }

    .footer {
        padding: var(--space-5) 0;
    }
}

/* Extra small devices (360px and below) */
@media (max-width: 360px) {
    .header-wrapper {
        gap: var(--space-2);
    }

    .nav-list {
        flex-direction: column;
        gap: var(--space-2);
        width: 100%;
    }

    .nav-link {
        text-align: center;
        width: 100%;
    }

    .social-link {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .course-group {
        padding: var(--space-4);
    }

    .course-list li {
        padding-left: var(--space-4);
    }
}

/* Landscape orientation on tablets */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: var(--space-2) 0;
    }

    .main-content {
        padding: var(--space-6) 0;
    }

    .teaching-intro {
        margin-bottom: var(--space-8);
    }

    .section-title {
        margin-bottom: var(--space-5);
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* ============================================
   ACCESSIBILITY & MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .nav-link {
        border: 2px solid transparent;
    }

    .nav-link.active,
    .nav-link:hover,
    .nav-link:focus {
        border-color: var(--color-primary);
    }

    .gallery-card,
    .course-group {
        border: 2px solid var(--color-border);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .header,
    .back-to-top,
    .header-social {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .gallery-card,
    .course-group {
        page-break-inside: avoid;
    }

    .gallery-image {
        filter: none !important;
    }

    .gallery-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

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

    a {
        color: black;
        text-decoration: underline;
    }
}