/*
Theme Name: iMedic Gran Via
Theme URI: https://imedicgranvia.com
Author: Eduard Dausa Ferrer
Description: Tema modern per Institut Medic Gran Via
Version: 2.1.0
*/

@import url('https://fonts.googleapis.com/css?family=Titillium+Web:wght@400;600;700&display=swap');

/* ============================================
   Estils del tema iMedic Gran Via
   Autor: Eduard Dausa Ferrer
   ============================================ */

/* Variables globals del tema - Colors i tipografia */
:root {
    --primary-color: #23759B;
    --secondary-color: #32A7E0;
    --font-primary: 'Titillium Web', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset bàsic - Elimina marges i paddings per defecte */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    background: #f5f7fa;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Header - Capçalera del lloc */
.site-header {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* Interior de la capçalera */
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    width: 100%;
}

/* Logo del lloc */
.logo img {
    height: 60px;
    width: auto;
}

/* Navegació principal */
.main-nav {
    display: block;
    visibility: visible;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav > ul {
    align-items: center;
}

.main-nav a {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

/* Estat actiu al passar el ratolí */
.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* Submenu - Menú desplegable */
.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 12px 0;
    z-index: 999;
    list-style: none;
    gap: 0;
    flex-direction: column;
    border-top: 3px solid var(--primary-color);
}

/* Elements del menú amb submenú */
.main-nav .menu-item-has-children {
    position: relative;
}

.main-nav .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.main-nav .sub-menu li {
    width: 100%;
}

.main-nav .sub-menu a {
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    display: block;
}

.main-nav .sub-menu a::after {
    display: none;
}

.main-nav .sub-menu a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Mobile menu button */
/* Botó del menú per a dispositius mòbils */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    border-radius: 2px;
}

/* Page Hero - Imatge de capçalera de les pàgines */
.page-hero {
    width: 100vw;
    height: 295px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Contingut dins del Page Hero */
.page-hero-content {
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
    padding-left: 20px;
}

.page-hero-content h1 {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    margin: 0;
}

/* Entry Content - Contingut de les pàgines */
.entry-content {
    padding: 40px 40px 60px;
    font-family: var(--font-primary);
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.entry-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.entry-content h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.entry-content p {
    margin-bottom: 1.2rem;
}

.entry-content ul, .entry-content ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.entry-content a:hover {
    color: var(--primary-color);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

#contenedor {
    max-width: 1040px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    opacity: 0.3;
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
    padding: 50px 60px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.6);
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.7;
    color: #fff;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Welcome Section */
.welcome-section {
    padding: 50px 0;
}

.welcome-section .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.welcome-section .section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.welcome-section .section-subtitle {
    text-align: center;
    color: #444;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.service-box {
    background: #fff;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.service-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(35, 117, 155, 0.15);
    border-color: var(--secondary-color);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.service-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
}

.service-box h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.service-box p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.content-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.content-card h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color);
}

.content-card p {
    color: #444;
    font-size: 1rem;
    line-height: 1.8;
}

.service-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e8ecf0;
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--secondary-color);
}

.service-item h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.service-item p {
    color: #666;
    font-size: 0.95rem;
}

/* Info Blocks */
.info-blocks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 50px 5% 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.info-block {
    background: var(--primary-color);
    color: #fff;
    padding: 35px 25px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.15);
    transition: all 0.3s ease;
    position: relative;
}

.info-block:last-child {
    border-right: none;
}

.info-block:last-of-type {
    border-right: none;
}

.info-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.info-block:hover::before {
    transform: scaleX(1);
}

.info-block:hover {
    background: var(--secondary-color);
}

.info-block:hover .block-icon {
    transform: scale(1.1);
    background: #fff;
}

.info-block:hover .block-icon svg {
    color: var(--secondary-color);
}

.info-block h3 {
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    font-weight: 700;
}

.info-block p {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.6;
    font-weight: 600;
}

.info-block a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.info-block a:hover {
    color: #fff;
    text-decoration: underline;
}

.block-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.block-icon svg {
    width: 32px;
    height: 32px;
    color: var(--secondary-color);
}

.info-block .social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.info-block .social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s ease;
}

.info-block .social-links a:hover {
    background: #fff;
    transform: translateY(-3px);
}

.info-block .social-links svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.info-block .social-links a:hover svg {
    color: var(--primary-color);
}

/* Footer */
.site-footer {
    background: #1a1a2e;
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.site-footer a {
    color: #fff;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.language-switcher a,
.language-switcher .lang-item,
.language-switcher li a,
.language-switcher ul li a {
    color: #fff !important;
    text-decoration: none;
    padding: 5px 10px;
    text-transform: uppercase;
    transition: opacity 0.3s;
}

.language-switcher a:hover,
.language-switcher .lang-item:hover,
.language-switcher li a:hover,
.language-switcher ul li a:hover {
    opacity: 0.7;
}

/* Cookie Banner */
#barraaceptacion {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    z-index: 9999;
    font-size: 0.9rem;
}

#barraaceptacion a {
    color: #fff;
    text-decoration: underline;
}

#barraaceptacion .ok {
    font-weight: bold;
    background: var(--secondary-color);
    padding: 5px 15px;
    border-radius: 4px;
    text-decoration: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-blocks {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-block {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    
    .info-block:nth-child(2n) {
        border-right: 1px solid rgba(255,255,255,0.15);
    }
    
    .info-block:nth-child(2n):last-child {
        border-right: none;
    }
    
    .info-block:nth-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section .section-title {
        font-size: 1.5rem;
    }
    
    .welcome-section .section-subtitle {
        font-size: 1rem;
    }
    
    .info-blocks {
        grid-template-columns: 1fr;
    }
    
    .info-block {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 4px;
    }
    
    .menu-toggle:hover {
        background: #f0f0f0;
    }
    
    .menu-toggle span {
        display: block;
        width: 26px;
        height: 3px;
        background: #333;
        margin: 5px 0;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .site-header {
        position: relative;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .header-inner {
        height: 65px;
        position: relative;
        padding: 0 15px;
        background: #fff;
    }
    
    .logo {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .logo img {
        height: 40px;
    }
    
    .main-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
        padding: 0;
        border-radius: 0 0 8px 8px;
    }
    
    .main-nav.active {
        display: block !important;
    }
    
    .main-nav > ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 20px 20px;
        margin: 0;
    }
    
    .main-nav > ul > li {
        border-bottom: 1px solid #eee;
        padding: 5px 0;
    }
    
    .main-nav > ul > li:last-child {
        border-bottom: none;
    }
    
    .main-nav a {
        display: block;
        padding: 14px 0;
        font-size: 15px;
    }
    
    .main-nav .sub-menu {
        display: none;
        position: static;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        padding: 0 0 10px 25px;
        background: transparent;
        min-width: auto;
    }
    
    .main-nav .sub-menu.active {
        display: block;
    }
    
    /* Ocultar TOTES les fletxes al submenu mobile */
    .main-nav .sub-menu a::after,
    .main-nav .menu-item-has-children > a::after,
    .main-nav .menu-item-has-children > a::before,
    .main-nav ul li a::after {
        display: none !important;
        content: none !important;
    }
    
    /* Estil links submenu mobile */
    .main-nav .sub-menu a {
        padding: 8px 0;
        font-size: 14px;
        color: #555;
        display: block;
    }
    
    .hero {
        min-height: 250px;
        padding: 20px 15px;
    }
    
    .hero-content {
        padding: 15px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .welcome-section {
        padding: 50px 20px;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .section-subtitle {
        margin-bottom: 30px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px;
    }
    
    .service-box {
        padding: 25px 20px;
    }
    
    .info-blocks {
        flex-direction: column;
        gap: 0;
    }
    
    .info-block {
        padding: 30px 25px;
        border-bottom: 1px solid #eee;
    }
    
    .info-block:last-child {
        border-bottom: none;
    }
    
    .site-footer {
        padding: 30px 20px;
    }
}

/* Gutenberg Editor Styles */
.wp-block {
    max-width: 100%;
}

.wp-block[data-align="wide"] {
    max-width: 1100px;
}

.wp-block[data-align="full"] {
    max-width: 100%;
}

.wp-block-button__link {
    background-color: var(--primary-color);
    border-radius: 4px;
    padding: 12px 24px;
}

.wp-block-button__link:hover {
    background-color: var(--secondary-color);
}

.wp-block-cover {
    border-radius: 8px;
    overflow: hidden;
}

.wp-block-group {
    padding: 20px;
    margin: 1rem 0;
}

/* Gutenberg Details Block */
.wp-block-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    margin: 1rem 0;
    border: 1px solid #e0e0e0;
}

.wp-block-details summary {
    background: var(--primary-color);
    color: #fff;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-block-details summary::-webkit-details-marker {
    display: none;
}

.wp-block-details summary::after {
    content: '+';
    font-size: 20px;
    font-weight: bold;
}

.wp-block-details[open] summary::after {
    content: '-';
}

.wp-block-details summary:hover {
    background: var(--secondary-color);
}

.wp-block-details .wp-block-details__content {
    padding: 20px;
    color: #333;
    line-height: 1.7;
}
