/*
 * style.css — Main stylesheet for sebastiri photo blog.
 *
 * Sections:
 *   Reset & Variables
 *   Header (fixed, frosted glass)
 *   Notification Bottom Bar (sign-up CTA on photo feed)
 *   Photo Feed (scroll-snap, full-viewport slides)
 *   Action Buttons (like, comment, message on each photo)
 *   Slide Panels (comments, message, email verification)
 *   Pages (about, privacy, account — .page-container)
 *   Forms (inputs, buttons, success/error/info messages)
 *   Comments
 *   Footer
 *   Loading skeleton
 */

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

:root {
  --text: #1a1a1a;
  --text-light: #666;
  --bg: #fff;
  --bg-overlay: rgba(255, 255, 255, 0.92);
  --border: #e8e8e8;
  --accent: #e74c3c;
  --accent-soft: #fde8e8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* ---- RSS Dropdown ---- */

.rss-wrap {
  position: relative;
}

.rss-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 16px;
  z-index: 101;
}

.rss-dropdown.open {
  display: block;
}

.rss-dropdown p {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.5;
}

.rss-dropdown .rss-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f7f7f7;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-light);
  word-break: break-all;
  margin-bottom: 10px;
}

.rss-dropdown .rss-url span {
  flex: 1;
}

.rss-dropdown .rss-copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.rss-dropdown .rss-copy-btn:hover {
  background: #eee;
}

.rss-dropdown .rss-readers {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.6;
}

.rss-dropdown .rss-readers a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.rss-dropdown .rss-readers a:hover {
  text-decoration: underline;
}

/* ---- Notification Bottom Bar ---- */

.nl-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.nl-bar.visible {
  transform: translateY(0);
}

.nl-bar.hidden {
  display: none;
}

.nl-bar-text {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.nl-bar form {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 320px;
}

.nl-bar input[type="email"] {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  min-width: 0;
  -webkit-appearance: none;
}

.nl-bar input[type="email"]:focus {
  outline: none;
  border-color: var(--text);
}

.nl-bar .nl-bar-btn {
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
}

.nl-bar .nl-bar-btn:hover {
  opacity: 0.85;
}

.nl-bar-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nl-bar .form-success {
  font-size: 0.8125rem;
  padding: 0;
  background: none;
  color: #2e7d32;
  display: none;
  margin: 0;
}

.nl-bar .form-success.visible {
  display: block;
}

@media (max-width: 480px) {
  .nl-bar {
    gap: 8px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .nl-bar-text {
    display: none;
  }

  .nl-bar form {
    max-width: none;
    flex: 1;
  }

  .nl-bar input[type="email"] {
    font-size: 16px;
  }

  .photo-actions {
    bottom: 80px;
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ---- Photo Feed ---- */

.photo-feed {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100vh;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

.photo-slide {
  scroll-snap-align: start;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.photo-slide img.loaded {
  opacity: 1;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 20px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  color: #fff;
}

.photo-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.photo-meta {
  font-size: 0.8125rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-meta .location::before {
  content: "\1F4CD";
  margin-right: 3px;
}

.photo-description {
  font-size: 0.875rem;
  margin-top: 6px;
  opacity: 0.9;
  max-width: 500px;
}

/* ---- Actions (Like + Comment) ---- */

.photo-actions {
  position: absolute;
  right: 16px;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.action-btn svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.action-btn:active svg {
  transform: scale(1.2);
}

.action-btn .label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.action-btn.liked svg {
  fill: var(--accent);
  color: var(--accent);
}

/* ---- Responsive tweaks ---- */

@media (min-width: 768px) {
  .photo-overlay {
    padding: 80px 40px 40px;
  }

  .photo-title {
    font-size: 1.75rem;
  }

  .photo-actions {
    right: 32px;
    bottom: 40px;
  }

  .photo-slide img {
    object-fit: contain;
  }

  .site-header {
    padding: 14px 32px;
  }
}

.like-animation {
  animation: likePop 0.35s ease;
}

@keyframes likePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---- Double-tap heart ---- */

.doubletap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10;
  pointer-events: none;
  animation: heartPop 0.9s ease forwards;
}

.doubletap-heart svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

@keyframes heartPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ---- Scroll Indicator ---- */

.scroll-hint {
  position: absolute;
  bottom: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  animation: scrollBounce 2s ease infinite;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.scroll-hint svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

.scroll-hint.hidden {
  display: none;
}

/* ---- Slide Panels (Comments + Message) ---- */

.slide-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 35%;
  z-index: 200;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .slide-panel {
    top: 10%;
  }
}

.slide-panel.open {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.panel-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}

.panel-body .submit-btn {
  width: auto;
}

@media (max-width: 480px) {
  .panel-body .submit-btn {
    width: 100%;
    justify-content: center;
  }
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.panel-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Message Panel specifics ---- */

.message-context {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #f7f7f7;
  border-radius: 8px;
  border-left: 3px solid var(--text);
}

/* ---- About Page ---- */

.page-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  flex: 1;
}

.page-container h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.page-container h2 {
  margin-top: 32px;
}

.page-container ul {
  padding-left: 1.25em;
  color: var(--text-light);
  margin-bottom: 16px;
}

.page-container p {
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* ---- Contact Form ---- */

.contact-form {
  margin-top: 32px;
}

.contact-form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--text);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}

.submit-btn:hover {
  opacity: 0.85;
}

.submit-btn:active {
  opacity: 0.7;
}

.form-success {
  padding: 16px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 8px;
  font-weight: 500;
  display: none;
}

.form-success.visible {
  display: block;
}

.form-error {
  padding: 12px;
  background: #fde8e8;
  color: #c0392b;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 12px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-info {
  padding: 16px;
  background: #fff8e1;
  color: #8d6e00;
  border-radius: 8px;
  font-weight: 500;
  display: none;
}

.form-info.visible {
  display: block;
}

/* ---- Comments ---- */

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.comments-loading,
.comments-empty {
  color: var(--text-light);
  font-size: 0.875rem;
  padding: 12px 0;
}

.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.comment-body {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* ---- Footer ---- */

.site-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 0.75rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

/* ---- Loading skeleton ---- */

.photo-slide.loading {
  background: linear-gradient(110deg, #f0f0f0 8%, #fafafa 18%, #f0f0f0 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}
