/* ===========================================
   RESPONSIVE STYLESHEET — Robert Hidri Portfolio
   
   This file handles ALL responsive behavior.
   Import AFTER style.css to override base styles.
   
   Breakpoints:
   - 1200px: Large tablets / small laptops
   - 1000px: Tablets landscape
   - 768px:  Tablets portrait
   - 600px:  Large phones
   - 480px:  Standard phones
   - 375px:  Small phones
   =========================================== */

/* ===== TABLET LANDSCAPE (1000px) ===== */
@media (max-width: 1000px) {
    /* Hero switches to single column */
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 700px;
    }
    
    .left-column, .right-column {
        position: relative;
        top: 0;
    }
    
    /* Profile + contact in a row */
    .left-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .profile-card {
        flex-shrink: 0;
    }
    
    /* Contact tiles wrap horizontally */
    .contact-mini {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
        min-width: 200px;
        justify-content: flex-start;
    }
    
    .contact-mini-tile {
        flex: 1;
        min-width: 150px;
        max-width: 200px;
    }
    
    /* Showcase preview single column */
    .showcase-preview {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .showcase-preview .preview-media {
        aspect-ratio: 21/9;
        max-height: 220px;
    }
    
    /* Skills sidebar becomes horizontal */
    .skills-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .skill-tab {
        flex: 1;
        min-width: 120px;
        max-width: 180px;
    }
}

/* ===== TABLETS PORTRAIT (768px) ===== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links a:not(.nav-cta) { 
        display: none; 
    }
    
    .nav-inner {
        padding: 0 1rem;
    }
    
    /* Hero compact adjustments */
    .hero-compact {
        padding: 4.5rem 1rem 1.5rem;
        min-height: auto;
    }
    
    .hero-layout {
        gap: 1.5rem;
    }
    
    /* Left column stacks vertically on smaller tablets */
    .left-column {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-mini {
        width: 100%;
        max-width: 280px;
    }
    
    .contact-mini-tile {
        max-width: none;
    }
    
    /* Project tiles - allow wrapping */
    .showcase-tiles {
        flex-wrap: wrap;
    }
    
    .showcase-tiles .project-tile {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 80px;
    }
    
    /* Skills sidebar adjustments */
    .skill-tab {
        min-width: 100px;
    }
    
    /* Sections */
    .section {
        padding: 2.5rem 1rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-subtitle {
        margin-top: -1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Journey grid single column */
    .journey-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* About grid */
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-highlights {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Skills grid */
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact grid */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hero stats */
    .hero-stats {
        gap: 1.5rem;
    }
    
    /* Modal adjustments */
    .modal-cv {
        width: 95vw;
        height: 80vh;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== LARGE PHONES (600px) ===== */
@media (max-width: 600px) {
    /* Profile photo wrapper smaller */
    .profile-photo-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .profile-photo {
        font-size: 2rem;
    }
    
    .profile-name {
        font-size: 1.25rem;
    }
    
    .profile-title {
        font-size: 0.7rem;
    }
    
    .profile-quick-stats {
        font-size: 0.7rem;
    }
    
    .bio-teaser {
        font-size: 0.7rem;
    }
    
    .bio-expand-btn {
        font-size: 0.625rem;
    }
    
    .bio-full-text {
        font-size: 0.7rem;
    }
    
    .bio-highlight {
        font-size: 0.5625rem;
    }
    
    /* Showcase preview */
    .showcase-preview {
        padding: 1rem;
        gap: 1rem;
    }
    
    .preview-title {
        font-size: 0.9rem;
    }
    
    .preview-description {
        font-size: 0.7rem;
        -webkit-line-clamp: 3;
    }
    
    /* Project tiles - 2 per row */
    .showcase-tiles .project-tile {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 70px;
        padding: 0.5rem;
    }
    
    .showcase-tiles .tile-icon {
        font-size: 1.1rem;
    }
    
    .showcase-tiles .tile-name {
        font-size: 0.5625rem;
    }
    
    /* Skills sidebar - full width tabs */
    .skills-sidebar {
        gap: 0.375rem;
    }
    
    .skill-tab {
        min-width: 80px;
        flex: 1 1 calc(50% - 0.25rem);
    }
    
    /* Journey tiles */
    .journey-tile {
        padding: 1rem;
    }
    
    .journey-tile h4 {
        font-size: 0.9rem;
    }
    
    /* Timeline */
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-marker {
        left: -1.5rem;
        width: 10px;
        height: 10px;
    }
    
    .timeline-header h3 {
        font-size: 1rem;
    }
    
    /* Reference cards */
    .reference-card {
        padding: 1.5rem;
    }
    
    .reference-card::before {
        font-size: 3rem;
        left: 1rem;
    }
    
    /* Hobbies grid */
    .hobbies-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer p {
        font-size: 0.75rem;
    }
}

/* ===== STANDARD PHONES (480px) ===== */
@media (max-width: 480px) {
    /* Hero */
    .hero-compact {
        padding: 4rem 0.75rem 1.5rem;
    }
    
    /* Profile */
    .profile-photo-wrapper {
        width: 100px;
        height: 100px;
        margin-bottom: 0.75rem;
    }
    
    .profile-photo {
        font-size: 1.75rem;
    }
    
    .profile-name {
        font-size: 1.125rem;
    }
    
    .profile-quick-stats {
        font-size: 0.65rem;
        gap: 0.375rem;
    }
    
    .profile-bio-preview {
        padding: 0.625rem;
    }
    
    .bio-teaser {
        font-size: 0.65rem;
    }
    
    .btn-sm {
        padding: 0.35rem 0.75rem;
        font-size: 0.7rem;
    }
    
    /* Contact mini */
    .contact-mini-tile {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .contact-mini-icon {
        font-size: 1rem;
    }
    
    /* Showcase */
    .showcase-preview {
        padding: 0.875rem;
    }
    
    .preview-media {
        max-height: 180px;
    }
    
    .preview-icon {
        font-size: 2.5rem;
    }
    
    .preview-title {
        font-size: 0.85rem;
    }
    
    .preview-tag {
        font-size: 0.5625rem;
        padding: 0.15rem 0.375rem;
    }
    
    /* Project tiles - still 2 per row but more compact */
    .showcase-tiles {
        gap: 0.375rem;
    }
    
    .showcase-tiles .project-tile {
        padding: 0.375rem;
        gap: 0.125rem;
    }
    
    .showcase-tiles .tile-icon {
        font-size: 1rem;
    }
    
    .showcase-tiles .tile-name {
        font-size: 0.5rem;
    }
    
    .showcase-tiles .tile-status {
        font-size: 0.4375rem;
    }
    
    /* Showcase more link */
    .showcase-more {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
    
    /* Skills tabs */
    .skill-tab {
        padding: 0.4rem 0.5rem;
    }
    
    .skill-tab-icon {
        font-size: 0.875rem;
    }
    
    .skill-tab-name {
        font-size: 0.625rem;
    }
    
    .skill-item {
        font-size: 0.5rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* About highlights */
    .about-highlights {
        grid-template-columns: 1fr;
    }
    
    /* Hero actions */
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    /* Section styling */
    .section {
        padding: 2.5rem 0.75rem;
    }
    
    .section h2 {
        font-size: 1.375rem;
    }
    
    .section-tag {
        font-size: 0.6875rem;
    }
    
    /* Journey */
    .journey-heading {
        font-size: 1rem;
    }
    
    .journey-tile {
        padding: 0.875rem;
    }
    
    .journey-tile-icon {
        font-size: 1.25rem;
    }
    
    .journey-tile h4 {
        font-size: 0.85rem;
    }
    
    .journey-tile p {
        font-size: 0.7rem;
    }
    
    .journey-meta span {
        font-size: 0.625rem;
    }
    
    /* Timeline expanded */
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .timeline-header h3 {
        font-size: 0.9375rem;
    }
    
    .timeline-date {
        font-size: 0.75rem;
    }
    
    .timeline-content > p {
        font-size: 0.8125rem;
    }
    
    /* Reference cards */
    .reference-card {
        padding: 1.25rem;
    }
    
    .reference-card blockquote {
        font-size: 0.8125rem;
        padding-left: 0.5rem;
    }
    
    .reference-author strong {
        font-size: 0.8125rem;
    }
    
    .reference-author span {
        font-size: 0.75rem;
    }
    
    /* Pills */
    .pill {
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .pill-sm {
        padding: 0.2rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    /* Contact cards */
    .contact-card {
        padding: 1.5rem 1rem;
    }
    
    .contact-icon {
        font-size: 1.5rem;
    }
    
    .contact-value {
        font-size: 0.8125rem;
    }
    
    /* Modal */
    .modal-header {
        padding: 0.875rem 1rem;
    }
    
    .modal-header h3 {
        font-size: 0.9rem;
    }
    
    .modal-footer {
        padding: 0.875rem 1rem;
    }
}

/* ===== SMALL PHONES (375px) ===== */
@media (max-width: 375px) {
    /* Nav */
    .nav-logo {
        font-size: 1.125rem;
    }
    
    .nav-cta {
        padding: 0.3rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Hero */
    .hero-compact {
        padding: 3.75rem 0.5rem 1.25rem;
    }
    
    .hero-layout {
        gap: 1rem;
    }
    
    /* Profile */
    .profile-inner {
        width: 100px;
        height: 100px;
        margin-bottom: 0.75rem;
    }
    
    .profile-photo {
        width: 60px;
        height: 60px;
        font-size: 1.125rem;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .profile-title {
        font-size: 0.625rem;
        margin-bottom: 0.5rem;
    }
    
    /* Showcase */
    .showcase-preview {
        padding: 0.75rem;
    }
    
    .preview-media {
        max-height: 150px;
    }
    
    .preview-title {
        font-size: 0.8rem;
    }
    
    .preview-description {
        font-size: 0.65rem;
        -webkit-line-clamp: 2;
    }
    
    /* Project tiles - stack to 3 per row */
    .showcase-tiles .project-tile {
        flex: 1 1 calc(33.333% - 0.375rem);
        min-width: 60px;
    }
    
    /* Skills */
    .skill-tab {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 70px;
    }
    
    /* Sections */
    .section {
        padding: 2rem 0.5rem;
    }
    
    .section h2 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    /* Contact mini */
    .contact-mini {
        gap: 0.375rem;
    }
    
    .contact-mini-tile {
        padding: 0.4rem 0.625rem;
        font-size: 0.6875rem;
        gap: 0.5rem;
    }
    
    .contact-mini-icon {
        font-size: 0.875rem;
    }
}

/* ===== VERY SMALL PHONES (320px) ===== */
@media (max-width: 320px) {
    .hero-compact {
        padding: 3.5rem 0.375rem 1rem;
    }
    
    .profile-inner {
        width: 90px;
        height: 90px;
    }
    
    .profile-photo {
        width: 55px;
        height: 55px;
        font-size: 1rem;
    }
    
    .profile-name {
        font-size: 0.9375rem;
    }
    
    .showcase-tiles .project-tile {
        flex: 1 1 calc(50% - 0.25rem);
    }
    
    .section {
        padding: 1.75rem 0.375rem;
    }
}

/* ===== LANDSCAPE PHONES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-compact {
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 1.5rem;
    }
    
    .hero-layout {
        grid-template-columns: 180px 1fr 160px;
        gap: 1rem;
        align-items: center;
    }
    
    .left-column {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .profile-inner {
        width: 80px;
        height: 80px;
        margin-bottom: 0.5rem;
    }
    
    .profile-photo {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .contact-mini {
        flex-direction: column;
    }
    
    .contact-mini-tile {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .showcase-preview {
        min-height: auto;
        padding: 0.75rem;
    }
    
    .preview-media {
        max-height: 120px;
    }
    
    .skills-sidebar {
        flex-direction: column;
    }
    
    .skill-tab {
        min-width: auto;
        max-width: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .nav,
    .modal,
    .btn,
    .showcase-more {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-compact {
        min-height: auto;
        padding: 1rem;
    }
    
    .section {
        background: transparent;
        padding: 1rem;
        page-break-inside: avoid;
    }
    
    .hero-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    
    .profile-front,
    .profile-back {
        animation: none !important;
    }
    
    .profile-front {
        transform: rotateY(0deg);
    }
    
    .profile-back {
        transform: rotateY(180deg);
    }
}

/* ===== LIGHT MODE responsive adjustments ===== */
[data-theme="light"] .nav-links.open,
[data-theme="light"] .nav-links {
    background: rgba(248, 249, 251, 0.95);
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --border: #4a5568;
        --border-hover: #718096;
        --text-muted: #cbd5e0;
        --text-dim: #a0aec0;
    }
    
    .skill-tab,
    .project-tile,
    .journey-tile,
    .contact-mini-tile {
        border-width: 2px;
    }
}
