/* ==========================================================================
   Franco Vögeli – Studio d'Architettura
   Responsive template based on the original 2013 design
   ========================================================================== */

:root {
    --bg: #02121a;
    --bg-box: #031a24;
    --text: #979797;
    --text-dim: #6c757a;
    --white: #ffffff;
    --border: #242526;
    --line: #1c2930;
    --line-2: #28363c;
    --accent: #4884a2;
    --gap: 32px;
    --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    font-size: 100%;
    overflow-y: scroll;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.75;
    letter-spacing: .12em;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--white); }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { font-weight: normal; margin: 0 0 .8em; line-height: 1.35; }
h1, h2 { font-size: 18px; color: var(--white); letter-spacing: .3em; text-transform: uppercase; }
h3 { font-size: 14px; color: var(--white); letter-spacing: .2em; text-transform: uppercase; }
h4 { font-size: 14px; color: var(--text); letter-spacing: .15em; }
p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 1000;
    background: var(--white); color: var(--bg); padding: 8px 14px; text-decoration: none;
}
.skip-link:focus { top: 10px; }

.center {
    width: 100%;
    max-width: 1153px;
    margin: 0 auto;
}

#wrapper { padding: 0 50px; }

/* ---------- Header ---------- */
.site-header { background: url(../Images/border.jpg) no-repeat left bottom; background-size: 100% 1px; }
.header-inner { position: relative; display: flex; justify-content: space-between; align-items: flex-start; min-height: 190px; }

.logo { order: 2; padding-top: 27px; margin-right: -4px; flex: 0 0 auto; }
.logo img { display: block; width: 268px; }

.nav-toggle,
.sub-toggle { display: none; }

.main-nav { order: 1; padding: 30px 0 20px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-l1 {
    position: relative;
    width: 130px;
    min-height: 147px;
    background: url(../Images/nav_bo.gif) no-repeat right 0;
}
.main-nav li { font-size: 12px; line-height: 21px; }
.main-nav a {
    display: block;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav li.active > a { color: var(--text); }

.nav-l2, .nav-l3 { display: none; position: absolute; top: 0; left: 100%; }
.nav-l2 { width: 200px; padding-left: 38px !important; }
.nav-l3 { width: 280px; padding-left: 38px !important; }

.nav-l1 > li.active > .nav-l2,
.nav-l2 > li.active > .nav-l3 { display: block; }
.nav-l1:hover > li.active:not(:hover) > .nav-l2 { display: none; }
.nav-l1 > li:hover > .nav-l2,
.nav-l1 > li:focus-within > .nav-l2 { display: block; }
.nav-l2:hover > li.active:not(:hover) > .nav-l3 { display: none; }
.nav-l2 > li:hover > .nav-l3,
.nav-l2 > li:focus-within > .nav-l3 { display: block; }
.nav-l1 > li:hover > .nav-l2,
.nav-l2 > li:hover > .nav-l3 { z-index: 5; }

/* ---------- Layout ---------- */
.site-main { padding: 41px 0 54px; }

.content-main {
    display: grid;
    grid-template-columns: 331px minmax(0, 1fr);
    gap: 0 var(--gap);
    align-items: start;
}
.left-part { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.right-part { min-width: 0; }
.show-mobile { display: none; }

.box {
    border: 1px solid var(--border);
    background: url(../Images/bg.png) no-repeat 0 0 var(--bg);
    background-size: 100% 100%;
    padding: 10px 14px 24px;
}
.box-title { padding: 24px 0 8px; margin: 0 0 12px; font-size: 18px; color: var(--white); letter-spacing: .3em; }

/* left navigation */
.left-nav { padding: 0 7px 40px; min-height: 140px; }
.left-nav .box-title { padding: 33px 7px 21px; margin: 0; }
.section-nav { list-style: none; margin: 0; padding: 0; }
.section-nav li { border-bottom: 1px solid #232d33; font-size: 12px; line-height: 2; }
.section-nav a {
    display: block;
    padding: 8px 30px 6px 11px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: .2em;
    background: url(../Images/nav_arrow.png) no-repeat right 8px center;
}
.section-nav a:hover,
.section-nav a:focus-visible,
.section-nav a.active {
    color: var(--white);
    background: url(../Images/button_arrow.png) no-repeat right 8px center, url(../Images/nav_bg.png) repeat-y 0 0;
}
.left-nav .empty { padding: 0 11px; }

/* content box (right) */
.main-content { display: grid; grid-template-columns: 1fr 1fr; gap: 30px var(--gap); }
.main-content > * { grid-column: 1 / -1; min-width: 0; }
.main-content > .frame-type-fvsite_projectsteaser { grid-column: auto; }

.content-box,
.main-content > .frame:not(.frame-type-fvsite_projectsteaser) {
    border: 1px solid #222425;
    background: url(../Images/bg1.png) no-repeat 0 0;
    background-size: 100% 100%;
    padding: 18px 24px 26px;
}
.main-content .frame > header h2,
.main-content .frame > header h1,
.content-box > h2 {
    font-size: 14px;
    color: var(--text);
    letter-spacing: .15em;
    margin-bottom: 21px;
}
.main-content p,
.content-box p { color: var(--white); line-height: 2; }
.main-content ul li,
.content-box ul li { color: var(--white); }
.main-content h3 {
    font-size: 12px;
    color: var(--text);
    background: url(../Images/h6.gif) no-repeat 0 .45em;
    padding: 0 0 6px 22px;
    margin-top: 1.8em;
    letter-spacing: .15em;
    border-bottom: 1px solid var(--line);
}
.main-content ul { list-style: none; padding-left: 22px; }
.main-content ul li { position: relative; }
.main-content ul li::before { content: "–"; position: absolute; left: -16px; color: var(--text); }

/* tables (studio facts, links, clients, project sheet) */
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.main-content table,
.detail-table { width: 100%; border-collapse: collapse; }
.main-content table td,
.main-content table th,
.detail-table th,
.detail-table td {
    padding: 4px 0 4px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: normal;
    vertical-align: top;
    text-align: left;
}
.main-content table td:first-child,
.detail-table th {
    color: var(--text);
    text-transform: uppercase;
    padding-left: 23px;
    background: url(../Images/h6.gif) no-repeat 0 .8em;
    width: 50%;
}
.main-content table td + td,
.detail-table td { color: var(--white); text-align: right; padding-left: 12px; }
.detail-table tr.gap th,
.detail-table tr.gap td { padding-top: 22px; background-position: 0 2.4em; }

/* frames inside the left "benvenuti" box */
.benvenuti { min-height: 411px; padding-bottom: 20px; }
.benvenuti header h2,
.benvenuti h2 { padding: 14px 0 18px; margin: 0; line-height: 1.4; }
.benvenuti p,
.benvenuti li { line-height: 20px; letter-spacing: 2px; font-size: 11px; }
.benvenuti ul { list-style: none; padding: 0; margin-top: -1em; }
.benvenuti ul li::before { content: "- "; }
.benvenuti em { font-style: italic; }

/* ---------- Gallery ---------- */
.gallery { margin-bottom: 12px; border: 1px solid var(--border); background: #000a0f; }
.gallery-stage { position: relative; aspect-ratio: 688 / 430; overflow: hidden; background: #000a0f; }
.gallery-slide {
    position: absolute; inset: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity .6s ease, visibility .6s;
}
.gallery-slide.is-active { opacity: 1; visibility: visible; }
.gallery-zoom { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; cursor: zoom-in; }
.gallery-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 64px; border: 0; cursor: pointer;
    background: rgba(2, 18, 26, .55) url(../Images/arrow-right.png) no-repeat center;
    opacity: .75; transition: opacity .2s;
}
.gallery-prev { left: 0; background-image: url(../Images/arrow-left.png); }
.gallery-next { right: 0; }
.gallery-nav:hover, .gallery-nav:focus-visible { opacity: 1; }
.gallery-counter {
    position: absolute; right: 10px; bottom: 8px;
    background: rgba(2, 18, 26, .7); color: var(--white);
    font-size: 10px; padding: 1px 8px;
}
.gallery-thumbs {
    list-style: none; margin: 0; padding: 8px;
    display: flex; gap: 8px; overflow-x: auto;
    border-top: 1px solid var(--border);
    scrollbar-width: thin;
}
.gallery-thumbs button {
    display: block; padding: 0; border: 1px solid transparent; background: none; cursor: pointer;
    opacity: .4; transition: opacity .2s;
}
.gallery-thumbs button.is-active,
.gallery-thumbs button:hover,
.gallery-thumbs button:focus-visible { opacity: 1; border-color: var(--text-dim); }
.gallery-thumbs img { width: 75px; height: 47px; object-fit: cover; display: block; }

/* lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 6, 9, .94);
    display: flex; align-items: center; justify-content: center;
    padding: 50px 60px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
    position: absolute; border: 0; background: none; color: var(--white);
    cursor: pointer; font-size: 34px; line-height: 1; padding: 10px 14px;
}
.lightbox-close { top: 6px; right: 10px; }
.lightbox-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Project sheet ---------- */
.project-sheet { padding: 14px 24px 25px; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.sheet-head h2 { font-size: 14px; color: var(--text); letter-spacing: .15em; margin: 0; }
.sheet-toggle {
    flex: 0 0 auto;
    border: 0; background: url(../Images/titel.png) no-repeat right center; color: var(--text);
    font: inherit; font-size: 11px; letter-spacing: .1em; cursor: pointer; padding: 0 36px 0 0;
}
.sheet-toggle[aria-expanded="false"] { background-image: url(../Images/titel1.png); }
.sheet-body[hidden] { display: none; }
.h6 {
    font-size: 12px; color: var(--text);
    background: url(../Images/h6.gif) no-repeat 0 13px;
    padding: 0 0 6px 22px; margin: 25px 0 8px; line-height: 28px; letter-spacing: 2px;
}
.h6 span { display: block; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.sheet-text { padding-left: 22px; color: var(--white); line-height: 2; }
.downloads { list-style: none; padding-left: 22px; }
.downloads a { text-decoration: none; }
.downloads a::before { content: "↓ "; color: var(--text); }

/* ---------- Product boxes (home / progetti) ---------- */
.product-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding-top: 38px; }
.product-box {
    border: 1px solid var(--border);
    background: url(../Images/bg.png) no-repeat 0 0 var(--bg);
    background-size: 100% 100%;
    display: flex; flex-direction: column;
    min-width: 0;
}
.product-img { display: block; }
.product-img img { display: block; width: 100%; aspect-ratio: 330 / 205; object-fit: cover; }
.product-detail { padding: 18px 16px 20px; display: flex; flex-direction: column; flex: 1; }
.product-detail h2 { margin: 0 0 12px; }
.product-detail h2 a { color: var(--white); text-decoration: none; }
.product-detail p { font-size: 11px; line-height: 18px; letter-spacing: 2px; }
.product-detail .button { margin-top: auto; align-self: flex-end; }
.product-box--plugin { padding: 0; }
.product-box--plugin .news-latest { padding: 16px 20px 10px; }

/* ---------- Buttons ---------- */
.button {
    display: inline-block;
    background: url(../Images/button.gif) repeat-y right top;
    padding: 0 5px;
    font-size: 11px;
    color: #8a9399;
    text-decoration: none;
    letter-spacing: .1em;
    line-height: 31px;
}
.button::after {
    content: "";
    display: inline-block;
    width: 10px; height: 14px;
    margin: 0 10px 0 12px;
    vertical-align: -2px;
    background: url(../Images/button_arrow.png) no-repeat center;
}
.button:hover, .button:focus-visible { color: var(--white); }
.button--light { background: var(--white); color: var(--bg); border: 0; padding: 0 18px; cursor: pointer; font: inherit; line-height: 34px; white-space: nowrap; flex: 0 0 auto; }
.button--light::after { display: none; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
.link-button:hover { color: var(--accent); }

/* ---------- News ---------- */
.news-latest .box-title { padding: 18px 0 6px; margin-bottom: 4px; }
.news-teaser {
    display: grid; grid-template-columns: 24px 1fr; gap: 14px;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--line-2);
}
.news-teaser.last { border-bottom: 0; }
.news-day {
    display: inline-block;
    width: 24px; height: 27px;
    background: url(../Images/news.png) no-repeat 0 0;
    color: var(--white); font-size: 13px; line-height: 27px; text-align: center; letter-spacing: 0;
}
.news-teaser h3 { font-size: 12px; letter-spacing: .12em; line-height: 18px; margin: 0 0 6px; text-transform: none; }
.news-teaser h3 a { color: var(--white); text-decoration: none; }
.news-teaser h3 a:hover { color: var(--accent); }
.news-teaser p { font-size: 11px; line-height: 18px; text-transform: uppercase; margin-bottom: 10px; }
.news-teaser .button { float: right; }
.news-box { padding-top: 0; }

.news-detail .news-date { display: flex; align-items: center; gap: 16px; color: var(--text); margin-bottom: 14px; }
.news-detail h2 { font-size: 14px; letter-spacing: .15em; text-transform: none; }
.news-text { color: var(--white); }

/* ---------- Footer ---------- */
.site-footer { background: url(../Images/border.jpg) no-repeat 0 0; background-size: 100% 1px; padding: 16px 0 22px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.copyright { font-size: 10px; color: var(--text-dim); line-height: 20px; letter-spacing: 2px; margin: 0; }
.copyright a { color: var(--text-dim); text-decoration: none; }
.copyright a:hover { color: var(--accent); }
.copyright .sep { padding: 0 4px; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.footer-nav li { padding: 0 9px; border-left: 1px solid #3a464c; line-height: 12px; margin: 4px 0; }
.footer-nav li:first-child { border-left: 0; padding-left: 0; }
.footer-nav li:last-child { padding-right: 0; }
.footer-nav a,
.footer-nav .link-button { color: var(--text-dim); font-size: 10px; letter-spacing: 2px; text-decoration: none; text-transform: uppercase; }
.footer-nav a:hover,
.footer-nav a.active { color: var(--accent); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1500;
    max-width: 760px; margin: 0 auto;
    display: flex; align-items: center; gap: 20px;
    background: #0a2531; border: 1px solid #2c4652;
    box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
    padding: 16px 20px;
    font-size: 11px; line-height: 1.7;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; color: #c8d0d4; }
.cookie-banner a { color: var(--white); }

/* ---------- Fluid styled content details ---------- */
.frame-type-menu_sitemap ul,
.frame-type-menu_subpages ul { list-style: none; padding-left: 0; }
.frame-type-menu_sitemap ul ul { padding-left: 22px; }
.frame-type-menu_sitemap a,
.frame-type-menu_subpages a { text-decoration: none; }
.ce-gallery img { border: 1px solid var(--border); }
.ce-bodytext a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    #wrapper { padding: 0 30px; }
    .content-main { grid-template-columns: 290px minmax(0, 1fr); --gap: 24px; }
    .product-row { --gap: 24px; }
}

@media (max-width: 900px) {
    #wrapper { padding: 0 16px; }
    body { font-size: 13px; }

    .header-inner { min-height: 0; align-items: center; padding: 18px 0; flex-wrap: wrap; }
    .logo { order: 1; padding-top: 0; margin-right: 0; }
    .logo img { width: 210px; }

    .nav-toggle {
        order: 2;
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; padding: 10px;
        background: none; border: 1px solid var(--border); cursor: pointer;
    }
    .nav-toggle-bar { display: block; height: 2px; background: var(--white); transition: transform .2s, opacity .2s; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .main-nav { order: 3; flex: 0 0 100%; padding: 0; display: none; }
    .main-nav.is-open { display: block; padding: 14px 0 6px; }
    .nav-l1 { width: auto; min-height: 0; background: none; }
    .main-nav li { font-size: 14px; line-height: 1.4; border-top: 1px solid var(--line); position: relative; }
    .main-nav a { padding: 12px 52px 12px 0; }
    .nav-l2, .nav-l3,
    .nav-l1 > li:hover > .nav-l2,
    .nav-l2 > li:hover > .nav-l3,
    .nav-l1 > li:focus-within > .nav-l2 { position: static; width: auto; display: none; padding-left: 18px !important; }
    .main-nav li.is-open > ul { display: block !important; }
    .nav-l1:hover > li.active:not(:hover) > .nav-l2 { display: none; }
    .nav-l2 a, .nav-l3 a { font-size: 13px; }
    .sub-toggle {
        display: block;
        position: absolute; right: 0; top: 2px;
        width: 44px; height: 42px; border: 0; background: none; cursor: pointer; color: var(--white);
    }
    .sub-toggle::before { content: "+"; font-size: 20px; line-height: 1; }
    .is-open > .sub-toggle::before { content: "–"; }

    .site-main { padding: 24px 0 40px; }
    .content-main { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .home-top .left-part { order: 2; }
    .home-top .right-part { order: 1; }
    .benvenuti { min-height: 0; }
    .hide-mobile { display: none; }
    .show-mobile { display: block; }
    .left-nav { min-height: 0; padding-bottom: 14px; }

    .product-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: 24px; }
    .product-row > .product-box--plugin { grid-column: 1 / -1; }
    .main-content { grid-template-columns: minmax(0, 1fr); }
    .main-content > .frame-type-fvsite_projectsteaser { grid-column: 1 / -1; }

    .footer-inner { flex-direction: column; }
    .cookie-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    h1, h2, .box-title { font-size: 16px; letter-spacing: .2em; }
    .product-row { grid-template-columns: minmax(0, 1fr); }
    .content-box,
    .main-content > .frame:not(.frame-type-fvsite_projectsteaser),
    .project-sheet { padding: 14px 14px 20px; }
    .main-content table td:first-child,
    .detail-table th { width: 42%; }
    .main-content table td,
    .main-content table th,
    .detail-table th,
    .detail-table td { font-size: 11px; }
    .gallery-nav { width: 36px; height: 52px; }
    .lightbox { padding: 50px 10px; }
    .copyright .sep { display: none; }
    .copyright { display: flex; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-slide { transition: none; }
}
