/* =========================================================
   GLOBCITY — MONTRA DE COMUNICAÇÕES
   Versão editorial / premium
   ========================================================= */

/* ---------------------------------------------------------
   Base da página
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f8f6f2;
    color: #4d4036;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   Contentor principal
   --------------------------------------------------------- */

.catalog-container {
    width: 92%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 70px 0 100px;
}

/* ---------------------------------------------------------
   Cabeçalho
   --------------------------------------------------------- */

.catalog-header {
    max-width: 820px;
    margin: 0 auto 55px;
    text-align: center;
}

.catalog-header h1 {
    margin: 0 0 18px;
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #3f332b;
}

.catalog-header p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: #79685b;
}

/* ---------------------------------------------------------
   Pequeno elemento editorial acima do título
   --------------------------------------------------------- */

.catalog-header::before {
    content: "GLOBCITY";
    display: block;
    margin-bottom: 18px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    color: #a78c74;
}

/* ---------------------------------------------------------
   Navegação das categorias
   --------------------------------------------------------- */

.category-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 65px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dfd5ca;
}

.category-navigation a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 30px;
    color: #6f5d4f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease;
}

.category-navigation a:hover {
    border-color: #d7c8b9;
    background: #eee8e0;
    color: #3f332b;
}

.category-navigation a.active {
    background: #4d4036;
    color: #fff;
}

/* ---------------------------------------------------------
   Grelha de categorias
   --------------------------------------------------------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 30px;
    border: 1px solid #dfd5ca;
    border-radius: 14px;
    background: #fffdf9;
    color: #4d4036;
    text-align: center;
    text-decoration: none;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #cdbba8;
    box-shadow: 0 18px 40px rgba(75, 57, 43, 0.08);
}

.category-card h2 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 400;
}

/* ---------------------------------------------------------
   Grelha dos templates
   --------------------------------------------------------- */

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 34px 26px;
}

/* ---------------------------------------------------------
   Cartão individual
   --------------------------------------------------------- */

.template-card {
    overflow: hidden;
    border: 1px solid #e0d7ce;
    border-radius: 14px;
    background: #fffdf9;
    box-shadow: 0 8px 25px rgba(65, 48, 35, 0.04);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(65, 48, 35, 0.10);
}

/* ---------------------------------------------------------
   Imagem / miniatura
   --------------------------------------------------------- */

.template-card > a {
    display: block;
    overflow: hidden;
    background: #eee8e0;
}

.template-image {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.template-card:hover .template-image {
    transform: scale(1.025);
}

/* ---------------------------------------------------------
   Conteúdo do cartão
   --------------------------------------------------------- */

.template-content {
    padding: 25px 26px 28px;
}

.template-content h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.25;
}

.template-content h2 a {
    color: #40342c;
    text-decoration: none;
}

.template-content h2 a:hover {
    color: #8a6f58;
}

.template-content p {
    margin: 0 0 20px;
    color: #78685c;
    font-size: 0.96rem;
    line-height: 1.65;
}

/* ---------------------------------------------------------
   Link de ação
   --------------------------------------------------------- */

.template-content h2 a::after {
    content: " →";
    white-space: nowrap;
    color: #a0846c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85em;
}

/* ---------------------------------------------------------
   Estado sem imagem
   --------------------------------------------------------- */

.template-card:not(:has(.template-image)) {
    min-height: 260px;
}

.template-card:not(:has(.template-image)) .template-content {
    padding-top: 38px;
}

/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .catalog-container {
        padding-top: 55px;
    }

    .category-grid,
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .template-image {
        height: 250px;
    }
}

/* ---------------------------------------------------------
   Telemóvel
   --------------------------------------------------------- */

@media (max-width: 600px) {

    .catalog-container {
        width: 90%;
        padding: 45px 0 70px;
    }

    .catalog-header {
        margin-bottom: 40px;
    }

    .catalog-header h1 {
        font-size: 2.5rem;
    }

    .catalog-header p {
        font-size: 1rem;
    }

    .category-grid,
    .template-grid {
        grid-template-columns: 1fr;
    }

    .category-navigation {
        margin-bottom: 45px;
    }

    .category-navigation a {
        padding: 7px 14px;
        font-size: 0.72rem;
    }

    .template-image {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .template-content {
        padding: 22px 21px 25px;
    }

    .template-content h2 {
        font-size: 1.25rem;
    }
}