/* ========================================
   MOBILE OPTIMIZATIONS
   Optimized for iPhone 13 & 16 (390px viewport)
   Applied for screens: 320px - 767px
   ======================================== */

/* === RESET & BASE === */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    font-size: 14px;
}

body {
    font-size: 14px;
    line-height: 1.5;
    padding: 0 16px;
    overflow-x: hidden;
    padding-bottom: 40px;
}

/* === HEADER === */
header {
    padding: 12px 0;
    width: 100%;
}

/* Name: centered (one rule, no duplicates) */
header h1 {
    font-size: 31px !important;
    letter-spacing: -1.5px !important;
    margin-left: 0 !important;
    text-align: center !important;
}

/* Subtext row: GRAPHIC DESIGNER --- SINCE 2022, matched to name width and centered */
header h1 .subtext {
    margin: -29px auto 0;
    font-size: 12px !important;
    letter-spacing: 0.3px !important;
    text-align: center;
}

header h1 .subtext:has(.sub-line) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 220px;
    max-width: 100%;
    gap: 8px;
}

.sub-role { display: inline !important; white-space: nowrap; }
.sub-since { white-space: nowrap; }

.sub-line {
    display: block !important;
    flex: 1;
    height: 1px;
    background: #999999;
}

/* === ETSY STORE BANNER (one rule, no duplicate) === */
.shop-banner {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 14px;
    padding: 18px 16px;
    background: #000000;
    border: 1px solid #333;
    border-radius: 6px;
    text-decoration: none;
    color: #FAF9F6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shop-banner:active {
    transform: scale(0.98);
}

.shop-banner-text {
    display: flex;
    flex-direction: column;
}

.shop-banner-logo {
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

.shop-banner-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-banner-sub {
    font-size: 12px;
    color: #999999;
}

/* === CONTAINER & LAYOUT === */
.container {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    max-width: 100%;
    margin: 0;
    min-height: auto;
    margin-top: 0;
}

/* === LEFT COLUMN (NAVIGATION) === */
.left-column {
    width: 100%;
    flex: none;
    padding: 0;
    margin: 0 0 32px 0;
}

nav ul {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.main-nav > li {
    font-size: 18px;
    letter-spacing: -0.3px;
    margin: 0 !important;
}

.dropdown-menu li {
    margin-top: 0 !important;
    margin-bottom: 1px !important;
}

nav a {
    font-size: 18px;
    display: block;
    padding: 12px 0;
    margin: 0;
    line-height: 1;
}

/* === DROPDOWN MENU === */
.dropdown-menu {
    display: none;
    list-style: none;
    margin: 8px 0 0 16px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dropdown-menu li {
    margin: 0 0 6px 0;
}

.dropdown-menu a {
    font-size: 15px;
    margin-top: 0;
    padding: 4px 0;
}

.dropdown.active > .dropdown-menu {
    display: block;
    max-height: 200px;
}

/* === RIGHT COLUMN === */
.right-column {
    width: 100%;
    flex: none;
    padding: 0;
    margin: 0;
}

/* === HOMEPAGE PROJECT GRID === */
#home-projects.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0;
    width: 100%;
    max-width: 390px;
}

#home-projects .project-image {
    height: auto;
    aspect-ratio: 1 / 1;
}

#home-projects .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#home-projects .project-info h3 {
    font-size: 18px;
}

/* === SECTION PROJECT GRIDS === */
.projects-container {
    width: 100%;
    padding: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0;
    width: 100%;
    max-width: 390px;
}

.project-tile {
    border-radius: 6px;
    border-width: 1px;
}

.project-image {
    height: auto;
    aspect-ratio: 1 / 1;
}

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

.project-info {
    padding: 10px;
}

.project-info h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.project-info p {
    font-size: 12px;
}

/* === IMAGE TILES (GALLERY PAGES) === */
.image-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0;
    width: 100%;
    max-width: 390px;
}

.tile-image {
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
}

/* === PAGE TITLES & DESCRIPTIONS === */
.page-title {
    font-size: 24px;
    margin-bottom: 12px;
    margin-top: 0;
}

.description {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 24px;
    padding: 0;
    max-width: 100%;
}

/* === PROJECT DETAIL PAGES === */
.project-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    padding: 0;
    width: 100%;
}

.project-description {
    position: static;
    order: -1;
    padding: 16px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
}

.project-description h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 8px;
}

.project-description p {
    font-size: 14px;
    line-height: 1.5;
}

.main-image {
    width: 100%;
    padding: 0;
    margin-bottom: 16px;
}

.main-image img {
    max-height: 60vh;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.detail-grid img {
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}

/* === ABOUT PAGE === */
.about-content {
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
    align-items: flex-start;
}

.profile-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: 4px;
}

.about-text {
    width: 100%;
}

.about-text p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* === PAGES SECTION === */
.pages-list {
    width: 100%;
    max-width: 100%;
}

.page-header {
    padding: 16px 0;
}

.page-title {
    font-size: 16px;
}

.page-date {
    font-size: 11px;
    margin-left: 0;
    margin-top: 4px;
}

.page-arrow {
    font-size: 14px;
}

.page-excerpt {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.read-more {
    font-size: 14px;
}

/* === POST PAGES === */
.post-header {
    margin-bottom: 24px;
}

.post-title {
    font-size: 28px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.post-date {
    font-size: 12px;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
}

.post-content p {
    margin-bottom: 20px;
}

.back-link {
    position: static;
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 14px;
}

.back-link a {
    display: inline-block;
    padding: 8px 0;
}

/* === CONTACT PAGE === */
.contact-info {
    margin-top: 20px;
}

.contact-item {
    margin-bottom: 24px;
}

.contact-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.contact-item p,
.contact-item a {
    font-size: 18px;
    line-height: 1.4;
}

/* === LOGO & SOCIAL (bottom row) === */
.social-container {
    position: static;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0;
    bottom: auto;
    left: auto;
}

.social-icon {
    width: 24px;
    height: 24px;
}

.mobile-bottom-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 24px 6px 10px;
}

/* Corner logo hidden on mobile (it lives in the Etsy tile now) */
.COOPER-BOWMAN-LOGO {
    display: none;
}

.region-indicator {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #999999;
    letter-spacing: 0.5px;
}

.region-flag {
    font-size: 16px;
    line-height: 1;
}

/* === FOOTER === */
footer {
    position: static;
    width: 100%;
    padding: 16px 12px;
    margin: 24px 0 0;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

/* === MODAL === */
.modal {
    padding: 12px;
}

.modal img {
    max-width: 95%;
    max-height: 85vh;
}

#modal-image {
    border-radius: 4px;
}

/* === TOUCH OPTIMIZATIONS === */
nav a,
.project-tile,
.tile-image,
.social-icon,
.read-more,
.back-link a {
    -webkit-touch-callout: none;
    user-select: none;
}

@media (hover: none) {
    .project-tile:hover {
        transform: none;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .tile-image:hover {
        transform: none;
        border-radius: 6px;
    }
    .project-tile:hover .project-image img {
        transform: none;
    }
    .social-icon:hover {
        transform: none;
    }
}

/* === ACTIVE STATES FOR TOUCH === */
.project-tile:active {
    transform: scale(0.98);
}

nav a:active {
    color: #999999;
}

.social-icon:active {
    transform: scale(0.95);
}

/* === PREVENT OVERSCROLL === */
html,
body {
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}

/* === SAFE AREA PADDING (notched devices) === */
@supports (padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* === LANDSCAPE ORIENTATION === */
@media (orientation: landscape) and (max-height: 500px) {
    nav ul li {
        font-size: 16px;
        margin-bottom: 8px;
    }
}

/* === SMALL PHONES (320px - 480px) === */
@media (max-width: 480px) {
    body {
        font-size: 13px;
        padding: 0 12px;
        padding-bottom: 40px;
    }

    nav ul {
        gap: 0px;
    }

    nav ul li {
        font-size: 16px;
    }

    nav a {
        padding: 2px 0;
    }

    .page-title {
        font-size: 20px;
    }

    .post-title {
        font-size: 24px;
    }

    #home-projects.projects-grid,
    .projects-grid,
    .image-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .project-info h3 {
        font-size: 12px;
    }

    .project-info p {
        font-size: 11px;
    }

    .contact-item p,
    .contact-item a {
        font-size: 16px;
    }

    .social-container {
        gap: 8px;
    }

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

    .page-item {
        border-bottom: 1px solid #333;
    }

    .page-header {
        padding: 12px 0;
        justify-content: center;
        text-align: center;
    }

    .page-title-text h3 {
        font-size: 16px !important;
        line-height: 1.3;
        margin: 0 0 4px 0;
    }

    .page-date {
        font-size: 11px !important;
    }

    .page-arrow {
        font-size: 16px;
    }

    .page-preview {
        padding: 0 0 12px 0;
    }

    .page-excerpt {
        font-size: 14px !important;
        line-height: 1.5;
        text-align: center;
    }

    .read-more {
        text-align: center;
    }

    .about-content {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    .profile-image {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .about-text p {
        font-size: 14px !important;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .contact-info {
        margin-top: 20px;
        width: 100%;
        text-align: center;
    }

    .contact-item {
        margin-bottom: 20px;
    }

    .contact-item h3 {
        font-size: 14px !important;
        margin-bottom: 8px;
        color: #999999;
        text-align: center;
    }

    .contact-item p,
    .contact-item a {
        font-size: 16px !important;
        line-height: 1.5;
        word-break: break-word;
        text-align: center;
    }

    .pages-list {
        text-align: center;
    }

    .page-title-text {
        text-align: center;
    }
}