/*
Theme Name: Telelettra
Version: 0.1.0
Text Domain: telelettra
*/

:root {
    --tt-ink: #1F1F1F;
    --tt-paper: #FFFFFF;
    --tt-accent: #E8300A;
    --tt-line: #dedad7;
    --tt-gutter: clamp(1.25rem, 5vw, 5rem);
    --tt-header: 72px;
    --tt-admin: 0px;
}
body.admin-bar { --tt-admin: 32px; }
@media (max-width: 782px) { body.admin-bar { --tt-admin: 46px; } }
@media (max-width: 600px) { body.admin-bar { --tt-admin: 0px; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--tt-paper); color: var(--tt-ink); font-family: system-ui, sans-serif; }
a { color: inherit; }
[id] { scroll-margin-top: calc(var(--tt-header) + var(--tt-admin) + 12px); }
:focus-visible { outline: 3px solid var(--tt-accent); outline-offset: 5px; }
.tt-skip { position: fixed; inset: 12px auto auto 12px; z-index: 1100; padding: 12px; background: white; }
.tt-skip:not(:focus) { clip-path: inset(50%); }
.tt-header {
    position: sticky;
    top: var(--tt-admin);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--tt-header);
    padding-inline: var(--tt-gutter);
    gap: 20px;
    background: var(--tt-paper);
    border-bottom: 1px solid var(--tt-line);
}
.tt-menu { position: relative; }
.tt-menu summary { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; font-weight: 650; }
.tt-menu summary::-webkit-details-marker { display: none; }
.tt-menu nav {
    position: absolute;
    inset: calc(100% + 10px) auto auto 0;
    min-width: min(280px, 80vw);
    max-height: calc(100dvh - 100px);
    overflow: auto;
    padding: 12px;
    background: var(--tt-paper);
    border: 1px solid var(--tt-line);
    box-shadow: 0 12px 30px #1f1f1f1f;
}
.tt-menu ul { list-style: none; padding: 0; margin: 0; }
.tt-menu a { display: block; padding: 12px; text-decoration: none; }
.tt-menu a:hover, .tt-menu .current-menu-item > a { background: #faeee9; }
.tt-brand { display: inline-flex; align-items: center; text-decoration: none; font-weight: 750; letter-spacing: .03em; }
.tt-brand img { display: block; width: auto; max-width: min(160px, 48vw); max-height: 48px; object-fit: contain; }
.tt-footer { padding: 28px var(--tt-gutter); background: var(--tt-ink); color: var(--tt-paper); border-top: 3px solid var(--tt-accent); font-weight: 650; }
.tt-page { padding: 44px var(--tt-gutter); }

.elementor .tt-scroll-stage { display: block; padding: 0; }
.elementor .tt-hero {
    isolation: isolate;
    position: relative;
    min-height: calc(100svh - var(--tt-header) - var(--tt-admin));
    background: var(--tt-ink);
}
.tt-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background: var(--tt-poster, none) center / cover no-repeat;
    filter: grayscale(1);
    pointer-events: none;
}
.tt-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, #111111ed, #1f1f1f66 70%, #e8300a55);
}
.elementor .tt-scroll-stage.has-scroll-film { min-height: calc(230svh - var(--tt-header) - var(--tt-admin)); }
.elementor .tt-scroll-stage.has-scroll-film .tt-hero {
    position: sticky;
    top: calc(var(--tt-header) + var(--tt-admin));
}
.tt-scroll-film {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    opacity: 0;
    pointer-events: none;
}
.is-scrubbing .tt-scroll-film { opacity: 1; }

.elementor .e-con.tt-wrap {
    width: min(calc(100% - 2 * var(--tt-gutter)), 1320px);
    margin-inline: auto;
}
.tt-section { border-top: 1px solid var(--tt-line); }
.tt-tint { background: #f6f3f1; }
.tt-measure p { max-width: 760px; }
.tt-section .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.elementor .e-con.tt-figures, .elementor .e-con.tt-areas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.elementor .e-con.tt-figure, .tt-area {
    padding: clamp(16px, 2.5vw, 36px);
    border: 1px solid var(--tt-line);
    background: var(--tt-paper);
}
.tt-area .elementor-heading-title a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--tt-accent);
    text-underline-offset: .19em;
}
.tt-area .elementor-heading-title a:hover { color: #a61f06; }
.elementor .e-con.tt-timeline { gap: 0; padding-inline-start: 8px; }
.elementor .e-con.tt-milestone {
    position: relative;
    border-inline-start: 1px solid var(--tt-accent);
    padding: 4px 0 30px 24px;
}
.tt-milestone::before {
    content: "";
    position: absolute;
    inset: 10px auto auto -6px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--tt-accent);
    border-radius: 50%;
    background: var(--tt-paper);
}
.elementor .e-con.tt-figure { border-top: 3px solid var(--tt-accent); }
.tt-opening-quote { border-inline-start: 3px solid var(--tt-accent); padding-inline-start: 20px; }
.tt-logo-carousel { padding-inline: 38px; }
.tt-logo-carousel .swiper-slide figure {
    display: grid;
    place-items: center;
    height: 104px;
    margin-inline: 5px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--tt-line);
}
.tt-logo-carousel .swiper-slide-image { max-width: 100%; max-height: 72px; object-fit: contain; }
.tt-logo-carousel .elementor-swiper-button {
    display: grid;
    place-items: center;
    width: 28px;
    min-height: 44px;
}
.tt-logo-carousel .elementor-swiper-button-prev { left: -32px; }
.tt-logo-carousel .elementor-swiper-button-next { right: -32px; }
.tt-project-shell {
    width: min(calc(100% - 2 * var(--tt-gutter)), 1320px);
    min-height: 50vh;
    margin-inline: auto;
    padding-block: clamp(36px, 7vw, 90px);
}
.tt-project-shell h1 {
    max-width: 25ch;
    margin-block: .4em .65em;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.1;
}
.tt-project-cover { max-width: 1050px; margin-bottom: 32px; }
.tt-project-cover img { display: block; width: 100%; height: auto; }
.tt-project-shell article > p { max-width: 72ch; line-height: 1.65; }
.tt-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tt-project-card { background: #fff; border: 1px solid var(--tt-line); }
.tt-project-card > a { display: block; height: 100%; color: var(--tt-ink); text-decoration: none; }
.tt-project-card > a:hover :is(h2, h3) { text-decoration: underline; }
.tt-project-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.tt-project-card-copy { padding: clamp(16px, 2.5vw, 30px); overflow-wrap: anywhere; }
.tt-project-card-copy :is(h2, h3) { margin: 0; font-size: 1.35rem; line-height: 1.25; }
.tt-project-card-copy p { margin: 12px 0 0; color: #484848; line-height: 1.55; }
.tt-project-empty { margin: 0; color: #484848; }
@media (max-width: 767px) {
    .elementor .e-con.tt-figures, .elementor .e-con.tt-areas { grid-template-columns: 1fr; }
    .tt-logo-carousel { padding-inline: 28px; }
    .tt-logo-carousel .swiper-slide figure { padding: 8px; }
    .tt-logo-carousel .elementor-swiper-button-prev { left: -28px; }
    .tt-logo-carousel .elementor-swiper-button-next { right: -28px; }
    .tt-project-grid { grid-template-columns: 1fr; }
}
