/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Times New Roman", Times, serif;
    background-color: #ffffff;
    color: #222222;
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    padding: 100px; /* outerPadding from source */
}

/* Canvas Layout - Universal Content Box */
#canvas {
    max-width: 1200px;
    margin: 0px auto;
    padding: 80px; /* pagePadding from source */
    border: 3px solid #e8e8e8; /* Light grey border like source */
    background-color: #ffffff;
}

.clear::after {
    content: "";
    display: table;
    clear: both;
}

/* Header Styles */
header {
    background-color: transparent;
    padding: 0;
    border: none;
    text-align: center;
    margin-bottom: 40px;
}

#upper-logo {
    margin-bottom: 15px; 
}

.site-title {
    text-align: center;
    margin: 0;
}

.site-title h1 {
    font-size: 58px;
    font-weight: normal;
    color: #222222;
    margin: 0;
    line-height: 1.2;
}

.site-title h1 a {
    color: inherit;
    text-decoration: none;
}

.site-tagline {
    text-align: center;
    font-size: 25px;
    color: #222222;
    margin: 22px 0 45px 0; 
    font-weight: normal;
}

/* Navigation */
nav {
    text-align: center;
    position: relative;
    margin-bottom: 60px; /* Increased by 50% */
}

/* Horizontal lines that break at navigation */
nav::before,
nav::after {
    content: '';
    position: absolute;
    top: 50%;
    height: 2px;
    background-color: #e8e8e8;
    z-index: 1;
}

nav::before {
    left: 0;
    right: 60%;
}

nav::after {
    right: 0;
    left: 60%;
}

nav ul {
    list-style: none;
    display: inline-flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0 20px;
    background-color: #ffffff;
    position: relative;
    z-index: 2;
}

nav li {
    display: inline-block;
    position: relative;
}

nav a {
    color: #222222;
    text-decoration: none;
    font-size: 13px;
    font-weight: normal;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

nav a:hover {
    font-weight: bold;
    text-decoration: underline;
}

nav a.active {
    color: #222222;
    text-decoration: none;
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: transparent;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.15s ease-in;
    padding-top: 10px;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
}

.dropdown-bracket {
    width: 100%;
    height: 25px;
    position: relative;
    margin-bottom: 5px;
}

.dropdown-bracket::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #e8e8e8;
}

.dropdown-bracket::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--bracket-width, calc(100% - 30px));
    height: 1px;
    background-color: #e8e8e8;
    border-radius: 0 0 8px 8px;
}

.dropdown-links {
    background-color: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 5px;
    padding: 15px 0;
}

.dropdown-links a {
    display: block;
    padding: 8px 20px;
    color: #222222;
    text-decoration: none;
    font-weight: normal;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.dropdown-links a:hover {
    font-weight: bold;
    text-decoration: underline;
    background-color: #f8f8f8;
}

/* Non-clickable dropdown triggers */
.dropdown-trigger {
    color: #222222;
    text-decoration: none;
    font-weight: normal;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
    pointer-events: none;
}

.dropdown-trigger:hover {
    font-weight: bold;
    text-decoration: underline;
}

/* Main Content */
main {
    padding: 0;
    min-height: auto;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    max-width: 1200px;
    margin: 40px auto 0;
}

.content-text {
    font-size: 13px;
    line-height: 1.6;
    padding-right: 20px;
}

.content-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-text p {
    margin-bottom: 22px; /* Increased by 50% */
}

.content-text hr {
    border: none;
    height: 1px;
    background-color: #222222;
    margin: 20px 0;
}

/* Portrait Image */
.portrait-container {
    text-align: left;
    padding-left: 20px;
}

.portrait {
    max-width: 100%;
    height: auto;
    border: 2px solid #222222;
    box-shadow: none;
}



/* Tablet Responsive */
@media (max-width: 1024px) {
    body {
        padding: 60px; /* Reduced outer padding on tablet */
    }

    #canvas {
        padding: 50px; /* Reduced page padding on tablet */
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 40px; /* Reduced outer padding on mobile */
    }

    #canvas {
        padding: 30px; /* Reduced page padding on mobile */
    }

    .site-title h1 {
        font-size: 2.5rem;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-top: 20px;
    }

    .gap-year-custom-grid {
        height: 350px;
        gap: 25px;
        margin: 30px 0 30px 0;
    }

    .gap-year-text-area {
        width: calc(100% - 30px) !important;
    }
    
    .content-text {
        order: 2;
    }
    
    .portrait-container {
        order: 1;
    }
    
    main {
        padding: 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px; /* Further reduced on very small screens */
    }

    #canvas {
        padding: 20px;
    }
    
    .site-title h1 {
        font-size: 2rem;
    }

    nav ul {
        gap: 8px;
    }

    .gap-year-custom-grid {
        height: 300px;
        gap: 15px;
        grid-template-rows: 1fr 1fr 1fr;
        margin: 15px 0 20px 0;
    }

    .gap-year-text-area {
        width: calc(100% - 20px) !important;
    }
}

/* Page-specific styles */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.6;
    padding: 0 40px;
}

.page-content h2 {
    color: #222222;
    font-size: 24px;
    margin-bottom: 30px; /* Increased by 50% from 20px */
    margin-top: 60px; /* Increased by 50% from 40px */
    font-weight: normal;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    color: #222222;
    font-size: 16px;
    margin-bottom: 22px; /* Increased by 50% from 15px */
    margin-top: 45px; /* Increased by 50% from 30px */
    font-weight: normal;
}

.page-content ul, .page-content ol {
    margin-left: 20px;
    margin-bottom: 22px; /* Increased by 50% */
}

.page-content li {
    margin-bottom: 7px; /* Increased by 50% */
}


/* --- Image Caption Styles --- */

.content-images figure {
    margin: 0; /* Removes default figure margin */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the caption horizontally */
}

.content-images figcaption {
    margin-top: 10px;  /* Adds 10px space below the image */
    font-size: 13px;   /* Match navigation font size */
    text-align: center; /* Center the caption */
}

.content-images figcaption a {
    color: #222222;
    text-decoration: none;
    font-weight: normal;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-images figcaption a:hover {
    font-weight: bold;
    text-decoration: underline;
}


/* Links */
a {
    color: #222222;
    text-decoration: none;
}

a:hover {
    color: #222222;
    text-decoration: none;
}

/* Horizontal Rule Styling */
hr {
    border: none;
    height: 1px;
    background-color: #e8e8e8;
    margin: 40px 0;
    width: 100%;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-40 {
    margin-top: 40px;
}

/* Gap Year Section */
.gap-year-custom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 30px;
    width: 100%;
    margin: 40px 0 40px 0;
    height: 1000px;
}

.gap-year-text-area {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    padding: 30px;
    background-color: #ffffff;
    border: 2px solid #e8e8e8;
    font-size: 15px;
    line-height: 1.6;
    overflow-y: auto;
}

.gap-year-text-area h2 {
    font-size: 35px;
    font-weight: bold;
    width: 100%;
}


.gap-year-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #e8e8e8;
    cursor: pointer;
    transition: border-color 0.3s ease;
    aspect-ratio: 1;
}

.gap-year-photo:hover {
    border-color: #d0d0d0;
}

.gap-year-photo[data-caption]:hover {
    border-color: #d0d0d0;
}

/* Position photos in specific grid locations */
.gap-year-custom-grid img:nth-of-type(1) { grid-column: 2; grid-row: 1; }
.gap-year-custom-grid img:nth-of-type(2) { grid-column: 3; grid-row: 1; }
.gap-year-custom-grid img:nth-of-type(3) { grid-column: 2; grid-row: 2; }
.gap-year-custom-grid img:nth-of-type(4) { grid-column: 3; grid-row: 2; }
.gap-year-custom-grid img:nth-of-type(5) { grid-column: 1; grid-row: 3; }
.gap-year-custom-grid img:nth-of-type(6) { grid-column: 2; grid-row: 3; }
.gap-year-custom-grid img:nth-of-type(7) { grid-column: 3; grid-row: 3; }

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    margin: 5% auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 5px;
}

.lightbox-caption {
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    max-width: 80%;
    margin-top: 15px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Cooking Grid */
.cooking-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 100px;
    max-width: 600px;
}

.cooking-photo {
    width: 100%;
    height: 175px;
    object-fit: cover;
    border: 1px solid #222222;
}

/* Project Images */
.project {
    margin-bottom: 40px;
}

.project-image {
    width: 500px;
    height: 400px;
    object-fit: cover;
    border: 2px solid #222222;
    float: right;
    margin: 0 0 20px 20px;
    transition: border-color 0.1s ease;
}

.project-image:hover {
    border-color: #d0d0d0;
}

/* Hobby Sections */
.hobby-section {
    margin: 30px 0;
}

.hobby-section h4 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Section breaks - simple line break not extending into margins */
hr {
    border: none;
    border-top: 1px solid #222222;
    margin: 30px 40px;
    width: calc(100% - 80px);
}

/* Hobbies Page Layout */
.hobbies-section {
    margin: 60px 0;
    display: grid;
    gap: 60px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

/* Cooking Section - 18% text, 82% images */
.cooking-section {
    grid-template-columns: 20% 80%;
}

/* Piano Section - 60% videos, 40% text */
.piano-section {
    grid-template-columns: 60% 40%;
}

.hobbies-section:first-child {
    margin-top: 40px;
}

.hobbies-section:last-child {
    margin-bottom: 40px;
}

.hobbies-text {
    font-size: 15px;
    line-height: 1.6;
}

.hobbies-text h3 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    margin-top: 0;
}

.hobbies-text p {
    margin-bottom: 15px;
    
}

/* Cooking Section - Text left, photos right */
.cooking-photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
    gap: 5px;
    width: 95%;
    margin-left: -20px;
}

.cooking-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid #e8e8e8;
    cursor: pointer;
    transition: border-color 0.1s ease;
}

.cooking-photo:hover {
    border-color: #d0d0d0;
}

/* Piano Section - Videos left, text right */
.piano-videos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.piano-video {
    width: 100%;
    height: 200px;
    border: 2px solid #e8e8e8;
}

/* Running Section - Text only, spans both columns */
.running-section {
    grid-template-columns: auto 1fr;
    gap: 40px;
    margin: 20px 0; /* Reduced margin for minimal whitespace */
    align-items: baseline; /* Align title and text at same baseline */
}

.running-section .title {
    font-size: 28px;
    font-weight: bold;
    margin: 0; /* Remove all margins to align with text */
    white-space: nowrap;
}

.running-text {
    font-size: 15px;
    line-height: 1.6;
}

/* Section Dividers */
.section-divider {
    border: none;
    height: 2px;
    background-color: #e8e8e8;
    margin: 60px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hobbies-section {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 40px 0;
    }

    .cooking-photos {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 10px;
    }

    .piano-video {
        height: 180px;
    }

    .running-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .running-section .title {
        white-space: normal;
    }

    .section-divider {
        margin: 40px 0;
    }
}

@media (max-width: 480px) {
    .cooking-photos {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
    }

    .piano-video {
        height: 160px;
    }
}

/* Image Caption System */
.gap-year-photo[data-caption],
.cooking-photo[data-caption],
.project-image[data-caption] {
    position: relative !important;
}

.gap-year-photo[data-caption]::after,
.cooking-photo[data-caption]::after,
.project-image[data-caption]::after {
    content: attr(data-caption);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(208, 208, 208, 0.85);
    color: #ffffff;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
    z-index: 10;
    display: block;
    min-height: 20px;
    box-sizing: border-box;
}

.gap-year-photo[data-caption]:hover::after,
.cooking-photo[data-caption]:hover::after,
.project-image[data-caption]:hover::after {
    opacity: 1;
}

/* Caption size variations based on text length */
.gap-year-photo[data-caption*=" "][data-caption*=" "][data-caption*=" "]::after,
.cooking-photo[data-caption*=" "][data-caption*=" "][data-caption*=" "]::after,
.project-image[data-caption*=" "][data-caption*=" "][data-caption*=" "]::after {
    padding: 10px 14px;
    font-size: 11px;
    line-height: 1.4;
}

/* School Page Styles */
.schools-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.school-item {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.school-logo {
    flex-shrink: 0;
}

.school-logo img {
    width: 150px;
    height: 150px;
    border: 2px solid #ada7a7;
    display: block;
}

.school-info {
    flex: 1;
}

.school-info h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #222222;
}

.school-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.school-info li {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: #222222;
}

.school-info li::before {
    content: "• ";
    margin-right: 8px;
}

.placeholder-text {
    font-style: italic;
    opacity: 0.7;
}

/* Responsive design for school page */
@media (max-width: 768px) {
    .schools-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .school-item {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .school-logo img {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
}

/* Footer */
footer {
    background-color: #ffffff;
    color: #222222;
    text-align: center;
    padding: 20px 0;
    border-top: none;
    font-size: 13px;
}

footer p {
    margin: 0;
}
