/* ============================================================
   PhotoAsso — Global Theme (Light / Dark + Responsive)
   ============================================================ */

/* ---------- 1. Custom Properties (Light) ---------- */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --color-surface: #ffffff;
    --color-border: #e0e0e0;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-danger: #ff3b30;
    --color-success: #34c759;
    --color-warning: #ff9f0a;
    --color-info: #5ac8fa;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --header-height: 56px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 56px;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
    --color-bg: #1d1d1f;
    --color-bg-alt: #2c2c2e;
    --color-surface: #2c2c2e;
    --color-border: #3a3a3c;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-primary: #2997ff;
    --color-primary-hover: #64b5f6;
    --color-shadow: rgba(0, 0, 0, 0.3);
}

/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: color 0.2s, background-color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- 3. Layout ---------- */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ---------- 4. Sidebar ---------- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    z-index: 200;
    overflow-y: auto;
    transition: width 0.3s ease, transform 0.3s ease, background-color 0.2s, border-color 0.2s;
}

.sidebar__header {
    position: relative;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--color-text);
}

.sidebar__brand:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.sidebar__logo {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar__name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.sidebar__desc {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    white-space: nowrap;
}

.sidebar__collapse-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 1;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar__collapse-btn:hover {
    color: var(--color-text);
    background-color: var(--color-bg-alt);
}

.sidebar__collapse-btn svg {
    transition: transform 0.3s ease;
}

.sidebar__nav {
    padding: 0.5rem 0;
}

.sidebar__section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.sidebar__section:last-child {
    border-bottom: none;
}

/* Section header: parent link + toggle button */
.sidebar__section-header {
    display: flex;
    align-items: center;
}

.sidebar__link--parent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    text-decoration: none;
    cursor: default;
    flex: 1;
    min-width: 0;
}

a.sidebar__link--parent {
    cursor: pointer;
    transition: color 0.15s;
}

a.sidebar__link--parent:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* Category icon */
.sidebar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar__icon svg {
    display: block;
}

/* Label text (hidden in collapsed mode) */
.sidebar__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section toggle (chevron) button */
.sidebar__section-toggle {
    background: none;
    border: none;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.sidebar__section-toggle:hover {
    color: var(--color-text);
}

.sidebar__chevron {
    transition: transform 0.25s ease;
}

/* Collapsed section: submenu hidden, chevron rotated */
.sidebar__section--collapsed .sidebar__submenu {
    display: none;
}

.sidebar__section--collapsed .sidebar__chevron {
    transform: rotate(-90deg);
}

.sidebar__submenu .sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem 0.4rem 2.75rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar__submenu .sidebar__link:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-alt);
}

/* Badges */
.sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    color: var(--color-text-secondary);
    background-color: var(--color-bg-alt);
    border-radius: 999px;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: none;
    letter-spacing: normal;
}

.sidebar__badge--primary {
    color: #fff;
    background-color: var(--color-primary);
}

/* ---------- 4a. Top Bar ---------- */
.top-bar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    padding: 0 1.5rem;
    gap: 1rem;
    transition: background-color 0.2s, border-color 0.2s;
}

[data-theme="dark"] .top-bar {
    background-color: rgba(29, 29, 31, 0.85);
}

.top-bar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
}

.top-bar__brand:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.top-bar__logo {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.top-bar__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar__name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    line-height: 1.2;
}

.top-bar__desc {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    white-space: nowrap;
}

.top-bar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar toggle button */
.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 199;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ---------- 4b. Layout Content ---------- */
.layout-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 4c. User menu ---------- */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu__trigger {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background-color 0.15s;
}

.user-menu__trigger:hover {
    background-color: var(--color-bg-alt);
    border-color: var(--color-text-secondary);
}

.user-menu__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--color-shadow);
    padding: 0.5rem 0 0.35rem;
    z-index: 200;
}

.user-menu:hover .user-menu__dropdown,
.user-menu:focus-within .user-menu__dropdown {
    display: block;
}

.user-menu__dropdown a {
    display: block;
    padding: 0.45rem 1rem;
    color: var(--color-text);
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.user-menu__dropdown a:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
}

.user-menu__dropdown form {
    margin: 0;
    padding: 0;
}

.user-menu__logout {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.45rem 1rem;
    color: var(--color-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    border-radius: 0;
}

.user-menu__logout:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-danger);
}

.user-menu__login {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    transition: color 0.15s, background-color 0.15s;
}

.user-menu__login:hover {
    color: var(--color-text);
    background-color: var(--color-bg-alt);
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: border-color 0.15s, background-color 0.15s;
    line-height: 1;
}

.theme-toggle:hover {
    background-color: var(--color-bg-alt);
    border-color: var(--color-text-secondary);
}

/* ---------- 4b. Breadcrumb (inside top-bar) ---------- */
.breadcrumb {
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb a[aria-current="page"] {
    color: var(--color-text);
    font-weight: 500;
}

.breadcrumb__sep {
    margin: 0 0.35rem;
    color: var(--color-border);
}

/* ---------- 5. Footer ---------- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
    transition: border-color 0.2s;
}

.site-footer__legal {
    font-size: 0.8rem;
    font-style: italic;
    max-width: 600px;
    margin: 0.75rem auto 0;
    line-height: 1.6;
}

.site-footer__contact {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.site-footer__contact a {
    color: var(--color-primary);
}

/* ---------- 6. Typography ---------- */
h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* ---------- 7. Links & Buttons ---------- */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    text-decoration: underline;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    background-color: var(--color-primary);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.1s;
}

button:hover,
.btn:hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
}

button:active,
.btn:active {
    transform: scale(0.98);
}

.btn--secondary {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--secondary:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn--danger {
    background-color: var(--color-danger);
}

.btn--danger:hover {
    background-color: #e0342b;
}

/* ---------- 8. Cards ---------- */
.blog-card,
.album-card,
.contest-card,
.member-card,
.submission-card,
.submission-result {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.blog-card:hover,
.album-card:hover,
.contest-card:hover,
.member-card:hover,
.submission-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--color-shadow);
}

.blog-card img,
.album-card img,
.contest-card img,
.member-card img,
.submission-card img,
.submission-result img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.blog-card > *:not(img):not(picture),
.album-card > *:not(img):not(picture),
.contest-card > *:not(img):not(picture),
.member-card > *:not(img):not(picture),
.submission-card > *:not(img):not(picture),
.submission-result > *:not(img):not(picture) {
    padding: 0.75rem 1rem;
}

.blog-card h2,
.album-card h2,
.contest-card h2,
.member-card h3 {
    margin-bottom: 0.25rem;
}

.blog-card h2 a,
.album-card h2 a,
.contest-card h2 a,
.member-card h3 a {
    color: var(--color-text);
    text-decoration: none;
}

.blog-card h2 a:hover,
.album-card h2 a:hover,
.contest-card h2 a:hover,
.member-card h3 a:hover {
    color: var(--color-primary);
}

.blog-card p,
.album-card p,
.contest-card p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* ---------- 9. Grids ---------- */
.blog-posts,
.albums-grid,
.contests-grid,
.members-grid,
.submissions-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ---------- 10. Photo Detail ---------- */
.photo-detail img {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

.exif-data {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.exif-data span {
    background-color: var(--color-bg-alt);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    transition: background-color 0.2s;
}

.likes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.comments {
    margin-top: 1.5rem;
}

.comment {
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: var(--color-bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: background-color 0.2s;
}

.comment small,
.comment time {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

.comment--reply {
    margin-left: 2rem;
    border-left-color: var(--color-text-secondary);
}

.comment--hidden {
    opacity: 0.5;
}

.comment__badge-hidden {
    display: inline-block;
    background-color: var(--color-warning);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    vertical-align: middle;
}

.comment__edited {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-style: italic;
}

.comment__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.comment__actions form {
    display: inline;
}

.comment__reply-form {
    display: none;
    margin-top: 0.75rem;
}

.comment__reply-form.active {
    display: block;
}

.comment__reply-form textarea {
    min-height: 60px;
    margin-bottom: 0.5rem;
}

/* ---------- 11. Profile ---------- */
.profile {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-section {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    transition: border-color 0.2s;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-bg-alt);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

/* ---------- 12. Forms ---------- */
.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

fieldset {
    border: none;
    padding: 1rem 0;
}

fieldset legend {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.errors {
    list-style: none;
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.errors li::before {
    content: "\2022 ";
}

.help {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.fields {
    max-width: 600px;
}

/* ---------- 13. Flash Messages ---------- */
.messages {
    list-style: none;
    margin-bottom: 1.5rem;
}

.messages li {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.messages .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.messages .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.messages .warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.messages .info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

[data-theme="dark"] .messages .success {
    background-color: rgba(52, 199, 89, 0.15);
    color: #34c759;
    border-color: rgba(52, 199, 89, 0.3);
}

[data-theme="dark"] .messages .error {
    background-color: rgba(255, 59, 48, 0.15);
    color: #ff6961;
    border-color: rgba(255, 59, 48, 0.3);
}

[data-theme="dark"] .messages .warning {
    background-color: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
    border-color: rgba(255, 159, 10, 0.3);
}

[data-theme="dark"] .messages .info {
    background-color: rgba(90, 200, 250, 0.15);
    color: #5ac8fa;
    border-color: rgba(90, 200, 250, 0.3);
}

/* ---------- 14. Gallery Nav ---------- */
.gallery-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gallery-nav a {
    background-color: var(--color-bg-alt);
    color: var(--color-text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
}

.gallery-nav a:hover,
.gallery-nav a.active {
    background-color: var(--color-primary);
    color: #fff;
}

/* ---------- 15. Hero ---------- */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.hero .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff;
}

.hero .hero-content h1 {
    color: #fff;
}

.hero-block {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-block img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Featured photo */
.featured-photo {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.featured-photo img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Welcome */
.welcome {
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---------- 16. Blog Article ---------- */
.author {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.intro {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.body {
    max-width: 700px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.body p {
    margin-bottom: 1rem;
}

.body img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.pull-quote {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    background-color: var(--color-bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: background-color 0.2s;
}

/* Blog categories */
.blog-categories {
    margin-bottom: 1.5rem;
}

.blog-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.blog-categories-list a {
    background-color: var(--color-bg-alt);
    color: var(--color-text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.blog-categories-list a:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* Recent posts sidebar */
.recent-posts {
    margin-top: 2rem;
}

.recent-posts a {
    display: block;
    padding: 0.5rem 0;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    transition: color 0.15s;
}

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

/* ---------- 17. Contest ---------- */
.phase {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: var(--color-primary);
    color: #fff;
    margin-bottom: 0.5rem;
}

.rules {
    background-color: var(--color-bg-alt);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    transition: background-color 0.2s;
}

.results {
    margin-top: 2rem;
}

.photographer {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* Submission result ranking */
.submission-result {
    position: relative;
}

/* Podium */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem 0;
}

.podium__place {
    text-align: center;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: background-color 0.2s;
    flex: 1;
    max-width: 300px;
}

.podium__place img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.podium__place--first {
    order: 2;
    flex: 1.3;
    max-width: 360px;
}

.podium__place--second {
    order: 1;
}

.podium__place--third {
    order: 3;
}

.podium__medal {
    display: block;
    font-size: 2.5rem;
    margin: 0.5rem 0 0;
}

.podium__place--first .podium__medal {
    font-size: 3rem;
}

.podium__author {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    padding: 0 0.75rem;
}

.podium__rank {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primary);
    padding: 0 0.75rem 0.75rem;
}

.podium__place h3 {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

/* Contest documents */
.contest-documents {
    background-color: var(--color-bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    transition: background-color 0.2s;
}

.contest-documents h2 {
    margin-bottom: 1rem;
}

.contest-documents p {
    margin-bottom: 0.75rem;
}

/* Inscription info */
.inscription-info {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background-color: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: background-color 0.2s;
}

.inscription-info p {
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.inscription-info p:last-child {
    margin-bottom: 0;
}

/* Podium clickable */
.podium__place {
    cursor: pointer;
}

.podium__place:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--color-shadow);
}

/* Podium responsive */
@media (max-width: 768px) {
    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium__place {
        order: unset !important;
        max-width: 100%;
        width: 100%;
    }

    .podium__place--first {
        flex: unset;
        max-width: 100%;
    }
}

/* ---------- 18. Owner Actions ---------- */
.owner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

/* ---------- 18b. Button variants ---------- */
.btn--small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ---------- 18c. Photo Manage Grid ---------- */
.photos-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.photo-manage-card {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    text-align: center;
    transition: background-color 0.2s;
}

.photo-manage-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.photo-manage-card p {
    padding: 0.4rem 0.5rem 0;
    font-size: 0.85rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-manage-card form {
    padding: 0.4rem 0.5rem 0.5rem;
}

/* ---------- 19. Gallery (justified-gallery overrides) ---------- */
.gallery {
    margin: 1.5rem 0;
}

/* ---------- 19. Tabs (Wagtail) ---------- */
.w-tabs__list {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    list-style: none;
    margin-bottom: 1.5rem;
}

.w-tabs__list button,
.w-tabs__list a {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.w-tabs__list button:hover,
.w-tabs__list a:hover,
.w-tabs__list button[aria-selected="true"],
.w-tabs__list a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: none;
}

.w-tabs__panel {
    padding: 1rem 0;
}

/* ---------- 20. Focal Point Picker ---------- */
.focal-point-picker {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    margin-bottom: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
}

.focal-point-picker img {
    display: block;
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.focal-point-picker__selection {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    display: none;
    z-index: 2;
}

.focal-point-picker__selection::before,
.focal-point-picker__selection::after {
    content: "";
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5);
}

/* Center crosshair horizontal */
.focal-point-picker__selection::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
}

/* Center crosshair vertical */
.focal-point-picker__selection::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
}

.focal-point-picker__actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ---------- 21. Desktop: Sidebar Collapsed (icon-only) ---------- */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }

    .top-bar__brand {
        display: none;
    }

    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
        overflow: visible;
    }

    .sidebar.collapsed .sidebar__header {
        padding: 0.5rem;
    }

    .sidebar.collapsed .sidebar__collapse-btn {
        position: static;
    }

    .sidebar.collapsed .sidebar__name,
    .sidebar.collapsed .sidebar__desc {
        display: none;
    }

    .sidebar.collapsed .sidebar__logo {
        max-width: 32px;
        max-height: 32px;
    }

    .sidebar.collapsed .sidebar__collapse-btn svg {
        transform: rotate(180deg);
    }

    .sidebar.collapsed .sidebar__nav {
        padding: 0.25rem 0;
    }

    .sidebar.collapsed .sidebar__section {
        padding: 0.25rem 0;
    }

    .sidebar.collapsed .sidebar__section-header {
        justify-content: center;
    }

    .sidebar.collapsed .sidebar__link--parent {
        justify-content: center;
        padding: 0.6rem 0;
        position: relative;
    }

    .sidebar.collapsed .sidebar__label {
        display: none;
    }

    /* Badge as dot indicator on icon in collapsed mode */
    .sidebar.collapsed .sidebar__badge {
        display: none;
    }

    .sidebar.collapsed .sidebar__badge--primary {
        display: block;
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 0.5rem;
        height: 0.5rem;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
    }

    .sidebar.collapsed .sidebar__submenu {
        display: none;
    }

    .sidebar.collapsed .sidebar__section-toggle {
        display: none;
    }

    .layout-content.expanded {
        margin-left: var(--sidebar-collapsed-width);
    }

    /* CSS tooltip for collapsed mode */
    .sidebar.collapsed .sidebar__link--parent::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background-color: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 0.3rem 0.6rem;
        white-space: nowrap;
        font-size: 0.8rem;
        font-weight: 400;
        text-transform: none;
        letter-spacing: normal;
        color: var(--color-text);
        box-shadow: 0 2px 8px var(--color-shadow);
        z-index: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
    }

    .sidebar.collapsed .sidebar__link--parent:hover::after {
        opacity: 1;
    }
}

/* ---------- 22. Responsive ---------- */

/* Tablet */
@media (max-width: 1024px) {
    main {
        padding: 1rem;
    }

    .blog-posts,
    .albums-grid,
    .contests-grid,
    .members-grid,
    .submissions-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    main {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Sidebar hidden by default on mobile */
    .sidebar,
    .sidebar.collapsed {
        width: var(--sidebar-width);
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Hide sidebar collapse button on mobile */
    .sidebar__collapse-btn {
        display: none;
    }

    /* No left margin on mobile */
    .layout-content,
    .layout-content.expanded {
        margin-left: 0;
    }

    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 0.8rem;
    }

    /* Grids single column */
    .blog-posts,
    .albums-grid,
    .contests-grid,
    .members-grid,
    .submissions-grid {
        grid-template-columns: 1fr;
    }

    /* Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    /* Hero */
    .hero .hero-content {
        padding: 1rem;
    }

    /* Body prose */
    .body {
        font-size: 1rem;
    }

    /* Photo detail */
    .exif-data {
        gap: 0.4rem;
    }

    .exif-data span {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .top-bar {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .top-bar__brand-text {
        display: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}
