/**
 * Diete Patologie - Design professionale medico
 * v3.0
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --primary-light: #E3F2FD;
    --success: #43A047;
    --success-light: #E8F5E9;
    --danger: #E53935;
    --danger-light: #FFEBEE;
    --warning: #F9A825;
    --warning-light: #FFFDE7;
    --text: #424242;
    --text-secondary: #616161;
    --text-muted: #9E9E9E;
    --bg: #F5F5F5;
    --bg-light: #FAFAFA;
    --white: #FFFFFF;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font-title: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
.dp-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg-light);
}

.dp-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.dp-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 500;
}

.dp-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.dp-breadcrumb a:hover {
    color: var(--primary);
}

.dp-breadcrumb .dp-sep {
    margin: 0 10px;
    color: var(--border);
}

.dp-breadcrumb strong {
    color: var(--text);
    font-weight: 600;
}

/* ==========================================================================
   Page header
   ========================================================================== */
.dp-page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 48px 40px;
    margin-bottom: 40px;
    text-align: center;
    color: var(--white);
}

.dp-page-header h1 {
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--white);
}

.dp-page-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Archive - Grid patologie
   ========================================================================== */
.dp-archive-intro {
    text-align: center;
    margin-bottom: 40px;
}

.dp-archive-intro p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 560px;
    margin: 0 auto;
}

.dp-patologie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.dp-patologia-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dp-patologia-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.dp-card-image {
    height: 160px;
    overflow: hidden;
    background: var(--bg);
}

.dp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.dp-patologia-card:hover .dp-card-image img {
    transform: scale(1.05);
}

.dp-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dp-card-body h3 {
    font-family: var(--font-title);
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.dp-card-body p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
    flex-grow: 1;
}

.dp-card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dp-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.dp-card-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* ==========================================================================
   Single patologia
   ========================================================================== */
.dp-patologia-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.dp-patologia-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dp-patologia-info {
    padding-top: 8px;
}

.dp-patologia-info h1 {
    font-family: var(--font-title);
    margin: 0 0 16px 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.dp-patologia-info > p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0 0 24px 0;
    line-height: 1.7;
}

.dp-patologia-stats {
    display: flex;
    gap: 32px;
}

.dp-stat {
    text-align: center;
    padding: 16px 24px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.dp-stat-value {
    display: block;
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.dp-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ==========================================================================
   Piani selector - Grid come le card
   ========================================================================== */
.dp-piani-section {
    margin: 48px 0;
}

.dp-piani-section h2 {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 24px 0;
}

.dp-piani-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dp-piano-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.dp-piano-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.dp-piano-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dp-piano-card .dp-kcal-value {
    font-family: var(--font-title);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.dp-piano-card.active .dp-kcal-value {
    color: var(--primary-dark);
}

.dp-piano-card .dp-kcal-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.dp-piano-card .dp-kcal-sublabel {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   Piano header
   ========================================================================== */
.dp-piano-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
    color: var(--white);
}

.dp-piano-header h1 {
    font-family: var(--font-title);
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--white);
}

.dp-piano-header .dp-subtitle {
    font-size: 15px;
    margin: 0 0 24px 0;
    opacity: 0.9;
}

.dp-piano-kcal {
    display: inline-flex;
    align-items: baseline;
    background: var(--white);
    padding: 16px 32px;
    border-radius: 50px;
}

.dp-piano-kcal .value {
    font-family: var(--font-title);
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.dp-piano-kcal .unit {
    font-size: 16px;
    color: var(--text-secondary);
    margin-left: 6px;
    font-weight: 500;
}

/* ==========================================================================
   Quick nav - Altri piani (stesso stile card)
   ========================================================================== */
.dp-quick-nav {
    margin: 32px 0 48px;
}

.dp-quick-nav h4 {
    font-family: var(--font-title);
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.dp-quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.dp-quick-nav-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 16px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.dp-quick-nav-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.dp-quick-nav-card.active {
    background: var(--primary);
    border-color: var(--primary);
}

.dp-quick-nav-card .nav-value {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.dp-quick-nav-card.active .nav-value {
    color: var(--white);
}

.dp-quick-nav-card .nav-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.dp-quick-nav-card.active .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Content sections
   ========================================================================== */
.dp-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 24px 0;
    overflow: hidden;
}

.dp-section-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
}

.dp-section-header h3 {
    font-family: var(--font-title);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.dp-section-content {
    padding: 28px;
}

/* Section variants */
.dp-section-menu .dp-section-header {
    background: var(--primary);
}

.dp-section-menu .dp-section-header h3 {
    color: var(--white);
}

.dp-section-warning .dp-section-header {
    background: var(--warning-light);
    border-color: #FFE082;
}

.dp-section-warning .dp-section-header h3 {
    color: #F57F17;
}

.dp-section-danger .dp-section-header {
    background: var(--danger-light);
    border-color: #EF9A9A;
}

.dp-section-danger .dp-section-header h3 {
    color: var(--danger);
}

.dp-section-success .dp-section-header {
    background: var(--success-light);
    border-color: #A5D6A7;
}

.dp-section-success .dp-section-header h3 {
    color: var(--success);
}

.dp-section-info .dp-section-header {
    background: var(--primary-light);
    border-color: #90CAF9;
}

.dp-section-info .dp-section-header h3 {
    color: var(--primary);
}

/* Lists in sections */
.dp-section-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dp-section-content li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-secondary);
}

.dp-section-content li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dp-section-content li:first-child {
    padding-top: 0;
}

.dp-section-content p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
}

.dp-section-content p:last-child {
    margin-bottom: 0;
}

/* Menu pasti */
.dp-menu-pasto {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.dp-menu-pasto:last-child {
    margin-bottom: 0;
}

.dp-menu-pasto strong {
    display: block;
    font-family: var(--font-title);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.dp-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    gap: 16px;
}

.dp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.dp-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.dp-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.dp-btn-outline {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}

.dp-btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.dp-btn-light {
    background: var(--white);
    border-color: var(--border);
    color: var(--text);
}

.dp-btn-light:hover {
    border-color: var(--text-muted);
}

/* ==========================================================================
   Placeholder
   ========================================================================== */
.dp-placeholder-img {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    height: 100%;
}

/* ==========================================================================
   Responsive - Mobile first
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .dp-patologie-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dp-piani-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dp-quick-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile landscape */
@media (max-width: 768px) {
    .dp-wrapper {
        padding: 24px 16px 40px;
    }
    
    .dp-page-header {
        padding: 32px 24px;
    }
    
    .dp-page-header h1 {
        font-size: 24px;
    }
    
    .dp-patologia-header {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
    
    .dp-patologia-image {
        max-width: 240px;
        margin: 0 auto;
    }
    
    .dp-patologia-info h1 {
        font-size: 26px;
    }
    
    .dp-patologia-stats {
        justify-content: center;
    }
    
    .dp-patologie-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dp-piani-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .dp-quick-nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .dp-piano-header {
        padding: 32px 20px;
    }
    
    .dp-piano-header h1 {
        font-size: 20px;
    }
    
    .dp-section-header,
    .dp-section-content {
        padding: 20px;
    }
    
    .dp-nav {
        flex-direction: column;
    }
    
    .dp-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .dp-page-header h1 {
        font-size: 22px;
    }
    
    .dp-patologia-info h1 {
        font-size: 22px;
    }
    
    .dp-patologia-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .dp-stat {
        width: 100%;
    }
    
    .dp-piani-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .dp-piano-card {
        padding: 16px 12px;
    }
    
    .dp-piano-card .dp-kcal-value {
        font-size: 24px;
    }
    
    .dp-quick-nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .dp-quick-nav-card {
        padding: 12px 8px;
    }
    
    .dp-quick-nav-card .nav-value {
        font-size: 16px;
    }
    
    .dp-piano-kcal .value {
        font-size: 32px;
    }
    
    .dp-card-body {
        padding: 20px;
    }
}
