/* ── Reset ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ───────────────────────────────────────────── */
body {
    background-color: #4d4d4d;
    color: #f0f0f0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
}

a { text-decoration: none; color: inherit; }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Dosis', sans-serif;
    color: #f0f0f0;
    font-weight: bold;
    text-align: center;
    margin: 0 2rem;
}
h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.3; }
h3 { font-size: 1.75rem; line-height: 1.4; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ── Header ─────────────────────────────────────────── */
header, footer { flex-shrink: 0; }

header {
    background: #424242;
    border-bottom: 1px solid #555;
    box-shadow: 0 2px 20px rgba(0,0,0,0.25);
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    text-align: center;
}

#language-switch {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 5px;
}

#language-switch img {
    width: 32px;
    height: auto;
    cursor: pointer;
    display: none;
}

/* Header typographic content (homepage) */
.header-name { text-align: center; }

.header-name h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.1;
}

.header-name p {
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #888;
    margin: 0.4rem 0 0;
    font-family: 'Dosis', sans-serif;
}

/* ── Main ───────────────────────────────────────────── */
main {
    flex-grow: 1;
    min-height: 0;
    padding: 2rem 4rem;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
}

main #principal {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    width: 100%;
    flex-grow: 1;
}

/* ── About Me ───────────────────────────────────────── */
#about-me {
    width: 380px;
    flex-shrink: 0;
    background: #424242;
    border: 1px solid #555;
    border-radius: 1rem;
    height: auto;
    position: relative;
    padding: 1.5rem;
    overflow: hidden;
}

#about-me::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00f5d4, #9b5de5, #f15bb5);
    border-radius: 1rem 1rem 0 0;
}

.about-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #00f5d4;
    margin-bottom: 0.75rem;
    font-family: 'Dosis', sans-serif;
}

#about-text {
    font-family: 'Dosis', sans-serif;
    font-size: 0.95rem;
    line-height: 1.85;
    color: #bbb;
    font-weight: 300;
    text-align: left;
}

/* ── Categories wrapper (right column) ──────────────── */
#categories-wrap {
    flex: 1;
    min-width: 0;
}

/* ── Categories Grid ────────────────────────────────── */
#categories {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
}

/* ── Category Card ──────────────────────────────────── */
.category-item {
    background: #424242;
    border: 1px solid #555;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #00f5d4);
    border-radius: 1rem 1rem 0 0;
    z-index: 4;
}

.category-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--accent-glow, rgba(0,245,212,0.22));
}

.category-item a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* Image wrapper */
.cat-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #383838;
}

/* SVG fallback — always rendered, sits under the real photo */
.svg-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.svg-fallback svg {
    width: 100%;
    height: 100%;
}

/* Color tint overlay on top of photo */
.cat-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    background: var(--accent, #00f5d4);
    opacity: 0.08;
    pointer-events: none;
}

/* Real photo — renders on top of SVG when available */
.cat-img-wrap img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.88);
    transition: filter 0.25s ease;
}

/* Transparent PNG (sculpting): show full figure, anchor to bottom */
.category-item[data-cat="02_sculpting"] .cat-img-wrap img {
    object-fit: contain;
    object-position: center bottom;
}

.category-item:hover .cat-img-wrap img {
    filter: brightness(1);
}

/* Category label */
.cat-label {
    display: block;
    padding: 0.6rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent, #00f5d4);
    font-family: 'Dosis', sans-serif;
}

/* ── Mobile menu categories ─────────────────────────── */
.cat-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #555;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: #f0f0f0;
}

.cat-dropdown-item:last-child { border-bottom: none; }
.cat-dropdown-item:hover { transform: translateX(4px); }

.cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent, #00f5d4);
    box-shadow: 0 0 6px var(--accent, #00f5d4);
}

.cat-thumb {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.3rem;
    flex-shrink: 0;
    background: #383838;
}

.cat-dropdown-name {
    flex: 1;
    font-family: 'Dosis', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent, #00f5d4);
}

.cat-arrow {
    font-size: 1.1rem;
    color: #888;
    flex-shrink: 0;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
    padding-top: 2rem;
    z-index: 1000;
    position: sticky;
    bottom: 0;
}

#dynamic-footer > p {
    background-color: #424242;
    padding: 20px;
    text-align: center;
    font-family: 'Dosis', sans-serif;
    font-size: 1rem;
    color: #f0f0f0;
    border-top: 1px solid #555;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
}

#dynamic-footer a {
    color: #00f5d4;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

#dynamic-footer a:hover { color: #00d4b7; }

#dynamic-footer p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.footer-icon { margin-right: 5px; }

/* ── Cookie Banner ──────────────────────────────────── */
#cookie-banner {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 20px;
    background-color: #424242;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.45);
    text-align: center;
    z-index: 10000;
}

#cookie-banner button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #00f5d4;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

#cookie-banner button:hover { background-color: #00d4b7; }

body.modal-open { overflow: hidden; }

/* ── Close button (projects / works pages) ──────────── */
#close-button-container {
    position: absolute;
    top: 0; bottom: 0;
    right: 4rem;
    display: flex;
    align-items: center;
    z-index: 1000;
}

#close-button {
    font-size: 2rem;
    color: #f0f0f0;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px; height: 50px;
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

#close-button:hover {
    transform: scale(1.1);
    background-color: rgba(255,255,255,0.1);
}

body.closing { animation: closePage 0.5s forwards; }

@keyframes closePage {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

/* ── Header-fix (projects.php / works.php) ──────────── */
#header-fix {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #424242;
    border-bottom: 1px solid #555;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    width: 100%;
    padding: 0;
}

.header-fix-inside {
    position: relative;
    padding: 0 4rem;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
}

/* ── Projects page ──────────────────────────────────── */
.projects-main-inside {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
}

#projects-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 4rem;
    align-items: start;
}

#projects-main #projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
    width: 100%;
    margin: 0 auto;
}

.project-item {
    box-shadow: 2px 3px 9px rgba(0,0,0,0.4);
    padding: 1rem;
    width: 100%;
    background: #424242;
    border: 1px solid #555;
    border-radius: 1rem;
    align-items: center;
    overflow: hidden;
}

.project-item > a {
    display: flex;
    flex-direction: column;
    width: 100%; height: 100%;
    transition: all 300ms ease-in-out;
}

.project-item > a:hover { opacity: 0.8; }

.project-item img {
    width: 100%; height: 260px;
    object-fit: cover;
    border-radius: 1rem;
}

.project-item p {
    padding: 1rem 0 0.5rem;
    font-family: 'Dosis', sans-serif;
    font-size: 1rem;
    color: #f0f0f0;
    margin: 0;
    text-align: center;
}

/* ── Mobile hamburger menu ──────────────────────────── */
#mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 0.6rem; left: 0.75rem;
    font-size: 1.6rem; line-height: 1;
    color: #f0f0f0;
    background: none; border: none;
    cursor: pointer;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    z-index: 1001; padding: 0;
}

#mobile-menu-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 8000;
}

#mobile-menu-overlay.open { display: block; }

#mobile-menu-panel {
    position: fixed;
    top: 0; left: -100%;
    width: 75vw; max-width: 280px; height: 100%;
    background: #424242;
    border-right: 1px solid #555;
    box-shadow: 3px 0 12px rgba(0,0,0,0.35);
    z-index: 9000;
    transition: left 0.28s ease;
    overflow-y: auto;
    padding: 0 0 2rem;
    display: none;
}

#mobile-menu-panel.open { left: 0; }

#mobile-menu-close {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    font-size: 2rem; line-height: 1;
    color: #f0f0f0;
    background: none; border: none;
    cursor: pointer;
    padding: 0.6rem 1rem 0.4rem;
}

#mobile-menu-content p {
    display: flex; flex-direction: column;
    align-items: stretch; gap: 0;
    margin: 0; padding: 0;
    border-top: none; box-shadow: none; background: none;
    font-size: 1rem; justify-content: flex-start;
}

#mobile-menu-content p span {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #555;
    font-family: 'Dosis', sans-serif;
    color: #f0f0f0;
    font-size: 0.95rem;
    text-align: left;
}

#mobile-menu-content p a {
    padding: 0.9rem 1.25rem;
    min-height: 44px;
    display: flex; align-items: center; justify-content: flex-start;
    border-bottom: 1px solid #555;
    color: #00f5d4;
    font-weight: bold;
    font-family: 'Dosis', sans-serif;
    font-size: 0.95rem;
    background: none; border-radius: 0;
    text-decoration: none;
}

#mobile-menu-content p a:hover { background: rgba(0,245,212,0.08); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1400px) {
    #projects-main #projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1000px) {
    main,
    #projects-main { padding: 2rem 3rem !important; }
    .header-fix-inside { padding: 0 3rem !important; }
    #close-button-container { right: 3rem !important; }
    #projects-main #projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
    main #principal { flex-direction: column; }
    #about-me { width: 100%; }
    #categories { display: none; }
    footer#dynamic-footer { display: none !important; }
    #mobile-menu-toggle { display: flex; }
    #mobile-menu-panel { display: block; }
}

@media (max-width: 768px) {
    main { padding: 2rem 2rem !important; }
    .header-fix-inside { padding: 0 2rem !important; }
    #close-button-container { right: 2rem !important; }
    #projects-main #projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
    #projects-main #projects-grid { grid-template-columns: 1fr; }
}
