/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Reset e stili base */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selezione del testo */
::-moz-selection {
    background-color: #885731;
    color: #fff;
}

::selection {
    background-color: #885731;
    color: #fff;
}

/* Layout e Grid */
.mdl-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.mdl-cell {
    flex: 1;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header e Navigazione */
.header {
    overflow: visible;
    background-color: white;
    width: 100%;
    position: relative;
    z-index: 100;
}

.header .material-icons {
    color: #767777 !important;
}

.header .mdl-layout__drawer-button {
    background: transparent;
    color: #767777;
}

.header .mdl-navigation__link {
    color: #757575;
    font-weight: 700;
    font-size: 14px;
}

.header .mdl-menu__container {
    z-index: 50;
    margin: 0 !important;
}

/* Navigation Container */
.navigation-container {
    direction: rtl;
    -webkit-order: 1;
    -ms-flex-order: 1;
    order: 1;
    width: 500px;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation {
    direction: ltr;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    width: 800px;
}

.navigation .mdl-navigation__link {
    display: inline-block;
    height: 60px;
    line-height: 68px;
    background-color: transparent !important;
    border-bottom: 4px solid transparent;
    transition: border-color 0.3s ease;
}

.navigation .mdl-navigation__link:hover {
    border-bottom: 4px solid #885731;
}

/* Search Box */
.search-box {
    -webkit-order: 2;
    -ms-flex-order: 2;
    order: 2;
    margin-left: 16px;
    margin-right: 16px;
}

.search-box .mdl-textfield__input {
    color: rgba(0, 0, 0, 0.87);
}

.search-box.is-focused + .navigation-container {
    opacity: 0;
    width: 100px;
}

/* Drawer */
.drawer {
    border-right: none;
    width: 100%;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.drawer-separator {
    height: 1px;
    background-color: #feffbe;
    margin: 8px 0;
}

.drawer .mdl-navigation__link.mdl-navigation__link {
    font-size: 14px;
    color: #757575;
    transition: color 0.3s ease;
}

.drawer span.mdl-navigation__link.mdl-navigation__link {
    color: #885731;
}

.drawer .mdl-layout-title {
    position: relative;
    background: #885731;
    height: 160px;
    width: 100%;
}

/* Logo e Immagini */
.logo-image {
    height: 28px;
    width: 140px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.drawer .logo-image {
    position: absolute;
    bottom: 16px;
}

/* Sezioni principali */
.first_section {
    position: relative;
    height: 100vh;
    width: 100%;
    background: #feffbe url('../Images/landascape.png') no-repeat center center;
    background-size: cover;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-section {
    position: relative;
    padding-top: 60px;
    padding-bottom: 80px;
    width: 100%;
    margin: 0;
}

/* Typography */
.logo-font {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1;
    color: #767777;
    font-weight: 500;
}

.claim {
    font-size: 60px;
    padding-top: 160px;
    margin: 0;
    text-align: center;
}

.claim_sub {
    font-size: 21px;
    padding-top: 24px;
    margin: 0;
    text-align: center;
}

.char {
    font-size: 21px;
    padding-top: 400px;
    text-align: center;
}

/* Links e Interazioni */
.link {
    text-decoration: none;
    color: #885731 !important;
    transition: color 0.3s ease;
}

.link:hover {
    color: #885731 !important;
    text-decoration: underline;
}

.link .material-icons {
    position: relative;
    top: -1px;
    vertical-align: middle;
}

.alt {
    text-decoration: none;
    color: #0d5c63 !important;
    font-size: 16px;
    transition: color 0.3s ease;
}

.alt:hover {
    color: #44a1a0 !important;
}

.alt .material-icons {
    position: relative;
    top: 6px;
}

/* Cards */
.card-container {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 4px;
}

.card-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-container .mdl-card__media {
    overflow: hidden;
    background: transparent;
    width: 100%;
    position: relative;
    aspect-ratio: 16/9;
}

.card-container .mdl-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card-container:hover .mdl-card__media img {
    transform: scale(1.05);
}

.card-container .mdl-card__title {
    background: transparent;
    height: auto;
    width: 100%;
    padding: 16px;
}

.card-container .mdl-card__title-text {
    color: black;
    height: auto;
    font-size: 1.2em;
}

.card-container .mdl-card__supporting-text {
    height: auto;
    color: black;
    padding: 16px;
    width: 100%;
}

.card-container .mdl-card__actions {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
}

.card-container .mdl-card__actions a {
    border-top: none;
    font-size: 16px;
    color: #885731;
}

/* Footer */
.footer {
    background-color: #fafafa;
    position: relative;
    width: 100%;
    padding: 40px 0;
}

.footer a {
    color: #757575;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #885731;
}

.footer .mdl-mega-footer--top-section::after,
.footer .mdl-mega-footer--middle-section::after {
    border-bottom: none;
}

.footer .mdl-mega-footer--bottom-section {
    position: relative;
    width: 100%;
    padding-top: 16px;
}

.footer .mdl-mega-footer--bottom-section a {
    margin-right: 2em;
}

.footer .mdl-mega-footer--right-section a .material-icons {
    position: relative;
    top: 6px;
}

/* Utility */
.link-menu:hover {
    cursor: pointer;
}

.mdl-textfield--expandable {
    width: auto;
}

.fab {
    position: absolute;
    right: 20%;
    bottom: -26px;
    z-index: 3;
    background: #885731 !important;
    color: black !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#view-source {
    position: fixed;
    display: block;
    right: 0;
    bottom: 0;
    margin-right: 40px;
    margin-bottom: 40px;
    z-index: 900;
    transition: transform 0.3s ease;
}

#view-source:hover {
    transform: scale(1.1);
}

/* Media Queries */
/* Mobile First */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .claim {
        font-size: 24px;
        padding-top: 80px;
    }

    .claim_sub {
        font-size: 16px;
        padding-top: 16px;
    }

    .card-container .mdl-card__media {
        aspect-ratio: 4/3;
    }

    .navigation {
        width: 100%;
    }

    .footer {
        padding: 20px 0;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .claim {
        font-size: 32px;
        padding-top: 120px;
    }

    .claim_sub {
        font-size: 18px;
        padding-top: 20px;
    }

    .navigation {
        width: 90%;
    }

    .card-container .mdl-card__media {
        aspect-ratio: 16/9;
    }
}

/* Laptop */
@media (min-width: 769px) and (max-width: 1024px) {
    .claim {
        font-size: 48px;
        padding-top: 140px;
    }

    .claim_sub {
        font-size: 20px;
        padding-top: 24px;
    }

    .navigation {
        width: 85%;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .claim {
        font-size: 60px;
        padding-top: 160px;
    }

    .claim_sub {
        font-size: 21px;
        padding-top: 24px;
    }

    .navigation {
        width: 800px;
    }
}

/* Landscape Mode */
@media (max-height: 480px) and (orientation: landscape) {
    .first_section {
        height: auto;
        min-height: 100vh;
    }

    .claim {
        padding-top: 40px;
    }

    .char {
        padding-top: 100px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .first_section {
        background-image: url('../Images/landascape.png');
    }
}

/* Print Styles */
@media print {
    .header,
    .navigation,
    .fab,
    #view-source {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .card-container {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
    }

    .first_section {
        background: none;
        height: auto;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1e1e1e;
        color: #ffffff;
    }

    .header {
        background-color: #1e1e1e;
    }

    .drawer {
        background-color: #1e1e1e;
    }

    .card-container {
        background-color: #1e1e1e;
    }

    .card-container .mdl-card__title-text,
    .card-container .mdl-card__supporting-text {
        color: #1e1e1e;
    }

    .footer {
        background-color: #1e1e1e;
    }
}
*/

/* ex Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #ffffff;
        color: #1e1e1e;
    }

    .header {
        background-color: #ffffff;
    }

    .drawer {
        background-color: #ffffff;
    }

    .card-container {
        background-color: #ffffff;
    }

    .card-container .mdl-card__title-text,
    .card-container .mdl-card__supporting-text {
        color: #ffffff;
    }

    .footer {
        background-color: #ffffff;
    }
}