/* ============================================================
   Interior Client Portal — portal.css
   Fonts: Cormorant Garamond (headings) + DM Sans (body)
   Palette: warm earth, natural clay, linen
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── Custom Properties ──────────────────────────────────────── */
:root {
    --bg:         #ffffff;
    --bg-card:    #D9D9D9;
    --bg-muted:   #e5e7eb;
    --hero-bg:    #101010;
    --gold:       #F26B31;
    --gold-light: #F69D35;
    --gold-pale:  #fdece4;
    --text:       #101010;
    --text-muted: #101010;
    --border:     #9CA3AF;
    --shadow-sm:  0 2px 8px rgba(16,16,16,.06);
    --shadow-md:  0 8px 28px rgba(16,16,16,.09);
    --shadow-lg:  0 20px 50px rgba(16,16,16,.12);
    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  22px;
    --transition: .28s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ────────────────────────────────────────────────── */
.icp-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Logout bar ─────────────────────────────────────────────── */
.icp-logout-bar {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1000;
}
.icp-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    background: var(--gold);
    color: #fff;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--transition), transform .15s;
}
.icp-logout-btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}
.icp-logout-btn:active {
    transform: translateY(0);
}

/* ============================================================
   HERO
   ============================================================ */
.icp-hero {
    background: var(--hero-bg);
    padding: 64px 48px;
    position: relative;
    overflow: hidden;
}

/* subtle decorative circles */
.icp-hero::before,
.icp-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: .07;
    background: var(--gold);
}
.icp-hero::before { width: 500px; height: 500px; top: -200px; right: -100px; }
.icp-hero::after  { width: 300px; height: 300px; bottom: -150px; left: -80px; }

.icp-hero--section { padding: 48px; }

.icp-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

/* breadcrumb / eyebrow */
.icp-hero-eyebrow {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.icp-breadcrumb-link {
    color: var(--gold-light);
    text-decoration: none;
    opacity: .8;
    transition: opacity var(--transition);
}
.icp-breadcrumb-link:hover { opacity: 1; }

.icp-hero-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 10px;
}

.icp-hero-tagline {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,.55);
    letter-spacing: .04em;
}

/* stat grid */
.icp-stats-grid {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.icp-stat {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    text-align: center;
    min-width: 96px;
}

.icp-stat-number {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
    margin-bottom: 6px;
}

.icp-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.icp-main {
    max-width: 1280px;
    width: 100%;
    margin: 48px auto;
    padding: 0 32px;
    flex: 1;
}

/* ── Empty state ── */
.icp-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.icp-empty i { font-size: 52px; margin-bottom: 18px; opacity: .35; display: block; }
.icp-empty p { font-size: 17px; }

/* ============================================================
   PROJECT CARD
   ============================================================ */
.icp-project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), transform var(--transition);
}
.icp-project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.icp-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 36px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.icp-project-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-pale);
    border-radius: 30px;
    padding: 4px 12px;
    margin-bottom: 8px;
}

.icp-project-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.icp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.icp-btn-primary {
    background: var(--hero-bg);
    color: #fff;
}
.icp-btn-primary:hover {
    background: #1e1a16;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    transform: translateY(-1px);
}

.icp-btn-ghost {
    background: transparent;
    color: var(--gold);
    border: 1.5px solid var(--gold);
}
.icp-btn-ghost:hover {
    background: var(--gold);
    color: #fff;
}

/* share button (small inline) */
.icp-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gold);
    background: var(--gold-pale);
    border: 1px solid rgba(242,107,49,.25);
    border-radius: 30px;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.icp-share-btn:hover {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* ============================================================
   SECTIONS (accordion rows inside a project)
   ============================================================ */
.icp-sections {
    padding: 8px 0;
}

.icp-section {
    border-bottom: 1px solid var(--border);
}
.icp-section:last-child { border-bottom: none; }

.icp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px 0 0;
    gap: 12px;
}

.icp-section-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 36px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    font-family: 'DM Sans', system-ui, sans-serif;
    transition: background var(--transition);
}
.icp-section-toggle:hover { background: var(--bg-muted); }

.icp-section-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 12px;
    flex-shrink: 0;
    transition: transform var(--transition), background var(--transition);
}

.icp-section[aria-expanded="true"] .icp-section-arrow,
.icp-section.open .icp-section-arrow {
    transform: rotate(90deg);
    background: var(--gold);
    color: #fff;
}

.icp-section-name {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.icp-section-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* section body (hidden by default) */
.icp-section-body {
    padding: 0 36px 28px;
    display: none;
}
.icp-section.open .icp-section-body { display: block; }

/* section portal — sections open by default */
.icp-section--open .icp-section-body { display: block; }
.icp-section--open .icp-section-arrow { transform: rotate(90deg); background: var(--gold); color: #fff; }

.icp-empty-note {
    color: var(--text-muted);
    font-size: 14px;
    padding: 16px 0;
}

/* ============================================================
   FOLDER
   ============================================================ */
.icp-folder {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.icp-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.icp-folder-info { flex: 1; }

.icp-folder-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text);
}
.icp-folder-title i { color: var(--gold); }

.icp-folder-counts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.icp-folder-counts span {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-muted);
    border-radius: 20px;
    padding: 3px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.icp-folder-body {
    display: none;
    border-top: 1px solid var(--border);
    animation: icp-fadein .25s ease;
}
.icp-folder.open .icp-folder-body { display: block; }

/* section-portal: folders open by default */
.icp-folder--open .icp-folder-body { display: block; }

@keyframes icp-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MEDIA SECTIONS (inside a folder)
   ============================================================ */
.icp-media-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}
.icp-media-section:last-child { border-bottom: none; }

.icp-media-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.icp-media-heading i { color: var(--gold); }

/* ── Gallery Grid ── */
.icp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.icp-gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    background: var(--bg-muted);
}

.icp-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.icp-gallery-item:hover .icp-gallery-image { transform: scale(1.06); }

.icp-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(16,14,11,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    color: #fff;
    font-size: 22px;
    pointer-events: none;   /* let clicks pass through to the image */
}
.icp-gallery-item:hover .icp-gallery-overlay { opacity: 1; }

/* ── Video Grid ── */
.icp-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.icp-video-grid video {
    width: 100%;
    border-radius: var(--radius-md);
    background: #000;
    display: block;
}

/* ── PDF List ── */
.icp-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.icp-pdf-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: border-color var(--transition), background var(--transition);
}
.icp-pdf-item:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
}

.icp-pdf-icon { color: #c0392b; font-size: 20px; flex-shrink: 0; }

.icp-pdf-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icp-pdf-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icp-pdf-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    background: var(--hero-bg);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.icp-pdf-preview-btn:hover {
    background: #2a2520;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    transform: translateY(-1px);
}

.icp-pdf-dl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gold);
    border: 1.5px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.icp-pdf-dl:hover {
    background: var(--gold);
    color: #fff;
}

/* ── PDF Preview Modal ── */
#icp-pdf-viewer {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(10,9,8,.92);
    display: none;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

.icp-pdf-viewer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    background: #1a1714;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.icp-pdf-viewer-title {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icp-pdf-viewer-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gold-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    transition: all .2s;
    white-space: nowrap;
}
.icp-pdf-viewer-download:hover { background: var(--gold); color: #fff; }

.icp-pdf-viewer-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}
.icp-pdf-viewer-close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }

#icp-pdf-frame {
    flex: 1;
    border: none;
    background: #525659;
    width: 100%;
    height: 100%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.icp-footer {
    text-align: center;
    padding: 32px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.icp-footer-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition);
}
.icp-footer-link:hover { color: var(--text); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .icp-hero { padding: 48px 32px; }
    .icp-hero-inner { flex-direction: column; align-items: flex-start; }
    .icp-stats-grid { width: 100%; justify-content: flex-start; }
    .icp-main { padding: 0 20px; }
    .icp-project-header { padding: 24px 24px; }
    .icp-section-toggle { padding: 18px 24px; }
    .icp-section-body { padding: 0 24px 20px; }
    .icp-section-header { padding-right: 20px; }
}

@media (max-width: 640px) {
    .icp-hero { padding: 36px 20px; }
    .icp-hero-name { font-size: 32px; }
    .icp-stats-grid { gap: 10px; }
    .icp-stat { padding: 14px 16px; min-width: 80px; flex: 1; }
    .icp-stat-number { font-size: 24px; }
    .icp-main { padding: 0 16px; margin: 28px auto; }
    .icp-project-header { flex-direction: column; align-items: flex-start; padding: 20px; }
    .icp-section-toggle { padding: 16px 20px; flex-wrap: wrap; }
    .icp-section-body { padding: 0 16px 16px; }
    .icp-section-header { padding-right: 16px; }
    .icp-folder-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .icp-folder-actions { width: 100%; flex-wrap: wrap; }
    .icp-folder-actions .icp-btn { flex: 1; justify-content: center; text-align: center; }
    .icp-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .icp-video-grid { grid-template-columns: 1fr; }
    .icp-project-title { font-size: 22px; }
}
